Advertisement
Guest User

yohoho-0--en-install.bin

a guest
Jul 13th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.67 KB | None | 0 0
  1. #!/bin/sh
  2. # This script was generated using Makeself 2.1.5
  3.  
  4. CRCsum="4160662609"
  5. MD5="7c6905db70c36c5643a0c3fece37b902"
  6. TMPROOT=${TMPDIR:=/tmp}
  7.  
  8. label="yoclient"
  9. script="./finish_install.sh"
  10. scriptargs="$0"
  11. targetdir="yohoho_install"
  12. filesizes="1188873"
  13. keep=n
  14.  
  15. print_cmd_arg=""
  16. if type printf > /dev/null; then
  17. print_cmd="printf"
  18. elif test -x /usr/ucb/echo; then
  19. print_cmd="/usr/ucb/echo"
  20. else
  21. print_cmd="echo"
  22. fi
  23.  
  24. unset CDPATH
  25.  
  26. MS_Printf()
  27. {
  28. $print_cmd $print_cmd_arg "$1"
  29. }
  30.  
  31. MS_Progress()
  32. {
  33. while read a; do
  34. MS_Printf .
  35. done
  36. }
  37.  
  38. MS_diskspace()
  39. {
  40. (
  41. if test -d /usr/xpg4/bin; then
  42. PATH=/usr/xpg4/bin:$PATH
  43. fi
  44. df -kP "$1" | tail -1 | awk '{print $4}'
  45. )
  46. }
  47.  
  48. MS_dd()
  49. {
  50. blocks=`expr $3 / 1024`
  51. bytes=`expr $3 % 1024`
  52. dd if="$1" ibs=$2 skip=1 obs=1024 conv=sync 2> /dev/null | \
  53. { test $blocks -gt 0 && dd ibs=1024 obs=1024 count=$blocks ; \
  54. test $bytes -gt 0 && dd ibs=1 obs=1024 count=$bytes ; } 2> /dev/null
  55. }
  56.  
  57. MS_Help()
  58. {
  59. cat << EOH >&2
  60. Makeself version 2.1.5
  61. 1) Getting help or info about $0 :
  62. $0 --help Print this message
  63. $0 --info Print embedded info : title, default target directory, embedded script ...
  64. $0 --lsm Print embedded lsm entry (or no LSM)
  65. $0 --list Print the list of files in the archive
  66. $0 --check Checks integrity of the archive
  67.  
  68. 2) Running $0 :
  69. $0 [options] [--] [additional arguments to embedded script]
  70. with following options (in that order)
  71. --confirm Ask before running embedded script
  72. --noexec Do not run embedded script
  73. --keep Do not erase target directory after running
  74. the embedded script
  75. --nox11 Do not spawn an xterm
  76. --nochown Do not give the extracted files to the current user
  77. --target NewDirectory Extract in NewDirectory
  78. --tar arg1 [arg2 ...] Access the contents of the archive through the tar command
  79. -- Following arguments will be passed to the embedded script
  80. EOH
  81. }
  82.  
  83. MS_Check()
  84. {
  85. OLD_PATH="$PATH"
  86. PATH=${GUESS_MD5_PATH:-"$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"}
  87. MD5_ARG=""
  88. MD5_PATH=`exec <&- 2>&-; which md5sum || type md5sum`
  89. test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which md5 || type md5`
  90. test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which digest || type digest`
  91. PATH="$OLD_PATH"
  92.  
  93. MS_Printf "Verifying archive integrity..."
  94. offset=`head -n 402 "$1" | wc -c | tr -d " "`
  95. verb=$2
  96. i=1
  97. for s in $filesizes
  98. do
  99. crc=`echo $CRCsum | cut -d" " -f$i`
  100. if test -x "$MD5_PATH"; then
  101. if test `basename $MD5_PATH` = digest; then
  102. MD5_ARG="-a md5"
  103. fi
  104. md5=`echo $MD5 | cut -d" " -f$i`
  105. if test $md5 = "00000000000000000000000000000000"; then
  106. test x$verb = xy && echo " $1 does not contain an embedded MD5 checksum." >&2
  107. else
  108. md5sum=`MS_dd "$1" $offset $s | eval "$MD5_PATH $MD5_ARG" | cut -b-32`;
  109. if test "$md5sum" != "$md5"; then
  110. echo "Error in MD5 checksums: $md5sum is different from $md5" >&2
  111. exit 2
  112. else
  113. test x$verb = xy && MS_Printf " MD5 checksums are OK." >&2
  114. fi
  115. crc="0000000000"; verb=n
  116. fi
  117. fi
  118. if test $crc = "0000000000"; then
  119. test x$verb = xy && echo " $1 does not contain a CRC checksum." >&2
  120. else
  121. sum1=`MS_dd "$1" $offset $s | CMD_ENV=xpg4 cksum | awk '{print $1}'`
  122. if test "$sum1" = "$crc"; then
  123. test x$verb = xy && MS_Printf " CRC checksums are OK." >&2
  124. else
  125. echo "Error in checksums: $sum1 is different from $crc"
  126. exit 2;
  127. fi
  128. fi
  129. i=`expr $i + 1`
  130. offset=`expr $offset + $s`
  131. done
  132. echo " All good."
  133. }
  134.  
  135. UnTAR()
  136. {
  137. tar $1vf - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 $$; }
  138. }
  139.  
  140. finish=true
  141. xterm_loop=
  142. nox11=n
  143. copy=none
  144. ownership=y
  145. verbose=n
  146.  
  147. initargs="$@"
  148.  
  149. while true
  150. do
  151. case "$1" in
  152. -h | --help)
  153. MS_Help
  154. exit 0
  155. ;;
  156. --info)
  157. echo Identification: "$label"
  158. echo Target directory: "$targetdir"
  159. echo Uncompressed size: 1396 KB
  160. echo Compression: gzip
  161. echo Date of packaging: Mon Jun 30 12:40:29 PDT 2014
  162. echo Built with Makeself version 2.1.5 on
  163. echo Build command was: "/usr/local/bin/makeself \\
  164. \"yohoho_install\" \\
  165. \"/export/manual_build/yohoho/production/projects/yoinstall/linux/../../../dist/installer/pages/yoclient/yohoho-install.bin\" \\
  166. \"yoclient\" \\
  167. \"./finish_install.sh\" \\
  168. \"$0\""
  169. if test x$script != x; then
  170. echo Script run after extraction:
  171. echo " " $script $scriptargs
  172. fi
  173. if test x"" = xcopy; then
  174. echo "Archive will copy itself to a temporary location"
  175. fi
  176. if test x"n" = xy; then
  177. echo "directory $targetdir is permanent"
  178. else
  179. echo "$targetdir will be removed after extraction"
  180. fi
  181. exit 0
  182. ;;
  183. --dumpconf)
  184. echo LABEL=\"$label\"
  185. echo SCRIPT=\"$script\"
  186. echo SCRIPTARGS=\"$scriptargs\"
  187. echo archdirname=\"yohoho_install\"
  188. echo KEEP=n
  189. echo COMPRESS=gzip
  190. echo filesizes=\"$filesizes\"
  191. echo CRCsum=\"$CRCsum\"
  192. echo MD5sum=\"$MD5\"
  193. echo OLDUSIZE=1396
  194. echo OLDSKIP=403
  195. exit 0
  196. ;;
  197. --lsm)
  198. cat << EOLSM
  199. No LSM.
  200. EOLSM
  201. exit 0
  202. ;;
  203. --list)
  204. echo Target directory: $targetdir
  205. offset=`head -n 402 "$0" | wc -c | tr -d " "`
  206. for s in $filesizes
  207. do
  208. MS_dd "$0" $offset $s | eval "gzip -cd" | UnTAR t
  209. offset=`expr $offset + $s`
  210. done
  211. exit 0
  212. ;;
  213. --tar)
  214. offset=`head -n 402 "$0" | wc -c | tr -d " "`
  215. arg1="$2"
  216. shift 2
  217. for s in $filesizes
  218. do
  219. MS_dd "$0" $offset $s | eval "gzip -cd" | tar "$arg1" - $*
  220. offset=`expr $offset + $s`
  221. done
  222. exit 0
  223. ;;
  224. --check)
  225. MS_Check "$0" y
  226. exit 0
  227. ;;
  228. --confirm)
  229. verbose=y
  230. shift
  231. ;;
  232. --noexec)
  233. script=""
  234. shift
  235. ;;
  236. --keep)
  237. keep=y
  238. shift
  239. ;;
  240. --target)
  241. keep=y
  242. targetdir=${2:-.}
  243. shift 2
  244. ;;
  245. --nox11)
  246. nox11=y
  247. shift
  248. ;;
  249. --nochown)
  250. ownership=n
  251. shift
  252. ;;
  253. --xwin)
  254. finish="echo Press Return to close this window...; read junk"
  255. xterm_loop=1
  256. shift
  257. ;;
  258. --phase2)
  259. copy=phase2
  260. shift
  261. ;;
  262. --)
  263. shift
  264. break ;;
  265. -*)
  266. echo Unrecognized flag : "$1" >&2
  267. MS_Help
  268. exit 1
  269. ;;
  270. *)
  271. break ;;
  272. esac
  273. done
  274.  
  275. case "$copy" in
  276. copy)
  277. tmpdir=$TMPROOT/makeself.$RANDOM.`date +"%y%m%d%H%M%S"`.$$
  278. mkdir "$tmpdir" || {
  279. echo "Could not create temporary directory $tmpdir" >&2
  280. exit 1
  281. }
  282. SCRIPT_COPY="$tmpdir/makeself"
  283. echo "Copying to a temporary location..." >&2
  284. cp "$0" "$SCRIPT_COPY"
  285. chmod +x "$SCRIPT_COPY"
  286. cd "$TMPROOT"
  287. exec "$SCRIPT_COPY" --phase2 -- $initargs
  288. ;;
  289. phase2)
  290. finish="$finish ; rm -rf `dirname $0`"
  291. ;;
  292. esac
  293.  
  294. if test "$nox11" = "n"; then
  295. if tty -s; then # Do we have a terminal?
  296. :
  297. else
  298. if test x"$DISPLAY" != x -a x"$xterm_loop" = x; then # No, but do we have X?
  299. if xset q > /dev/null 2>&1; then # Check for valid DISPLAY variable
  300. GUESS_XTERMS="xterm rxvt dtterm eterm Eterm kvt konsole aterm"
  301. for a in $GUESS_XTERMS; do
  302. if type $a >/dev/null 2>&1; then
  303. XTERM=$a
  304. break
  305. fi
  306. done
  307. chmod a+x $0 || echo Please add execution rights on $0
  308. if test `echo "$0" | cut -c1` = "/"; then # Spawn a terminal!
  309. exec $XTERM -title "$label" -e "$0" --xwin "$initargs"
  310. else
  311. exec $XTERM -title "$label" -e "./$0" --xwin "$initargs"
  312. fi
  313. fi
  314. fi
  315. fi
  316. fi
  317.  
  318. if test "$targetdir" = "."; then
  319. tmpdir="."
  320. else
  321. if test "$keep" = y; then
  322. echo "Creating directory $targetdir" >&2
  323. tmpdir="$targetdir"
  324. dashp="-p"
  325. else
  326. tmpdir="$TMPROOT/selfgz$$$RANDOM"
  327. dashp=""
  328. fi
  329. mkdir $dashp $tmpdir || {
  330. echo 'Cannot create target directory' $tmpdir >&2
  331. echo 'You should try option --target OtherDirectory' >&2
  332. eval $finish
  333. exit 1
  334. }
  335. fi
  336.  
  337. location="`pwd`"
  338. if test x$SETUP_NOCHECK != x1; then
  339. MS_Check "$0"
  340. fi
  341. offset=`head -n 402 "$0" | wc -c | tr -d " "`
  342.  
  343. if test x"$verbose" = xy; then
  344. MS_Printf "About to extract 1396 KB in $tmpdir ... Proceed ? [Y/n] "
  345. read yn
  346. if test x"$yn" = xn; then
  347. eval $finish; exit 1
  348. fi
  349. fi
  350.  
  351. MS_Printf "Uncompressing $label"
  352. res=3
  353. if test "$keep" = n; then
  354. trap 'echo Signal caught, cleaning up >&2; cd $TMPROOT; /bin/rm -rf $tmpdir; eval $finish; exit 15' 1 2 3 15
  355. fi
  356.  
  357. leftspace=`MS_diskspace $tmpdir`
  358. if test $leftspace -lt 1396; then
  359. echo
  360. echo "Not enough space left in "`dirname $tmpdir`" ($leftspace KB) to decompress $0 (1396 KB)" >&2
  361. if test "$keep" = n; then
  362. echo "Consider setting TMPDIR to a directory with more free space."
  363. fi
  364. eval $finish; exit 1
  365. fi
  366.  
  367. for s in $filesizes
  368. do
  369. if MS_dd "$0" $offset $s | eval "gzip -cd" | ( cd "$tmpdir"; UnTAR x ) | MS_Progress; then
  370. if test x"$ownership" = xy; then
  371. (PATH=/usr/xpg4/bin:$PATH; cd "$tmpdir"; chown -R `id -u` .; chgrp -R `id -g` .)
  372. fi
  373. else
  374. echo
  375. echo "Unable to decompress $0" >&2
  376. eval $finish; exit 1
  377. fi
  378. offset=`expr $offset + $s`
  379. done
  380. echo
  381.  
  382. cd "$tmpdir"
  383. res=0
  384. if test x"$script" != x; then
  385. if test x"$verbose" = xy; then
  386. MS_Printf "OK to execute: $script $scriptargs $* ? [Y/n] "
  387. read yn
  388. if test x"$yn" = x -o x"$yn" = xy -o x"$yn" = xY; then
  389. eval $script $scriptargs $*; res=$?;
  390. fi
  391. else
  392. eval $script $scriptargs $*; res=$?
  393. fi
  394. if test $res -ne 0; then
  395. test x"$verbose" = xy && echo "The program '$script' returned an error code ($res)" >&2
  396. fi
  397. fi
  398. if test "$keep" = n; then
  399. cd $TMPROOT
  400. /bin/rm -rf $tmpdir
  401. fi
  402. eval $finish; exit $res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement