Advertisement
Guest User

CrashPlan's install.sh

a guest
Nov 16th, 2012
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 16.25 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #############################################################
  4. # Linux Client Installer Script
  5. #############################################################
  6.  
  7. # variables defined in install.defaults
  8. # APP_BASENAME = human-readable application name
  9. # DIR_BASENAME = dir name
  10. # DOWNLOAD_HOST = where to get the jre
  11.  
  12. SCRIPT_DIR=`dirname ${0}`
  13. if [ ! -f "${SCRIPT_DIR}/install.defaults" ] ; then
  14.     echo "${SCRIPT_DIR}/install.defaults MISSING!"
  15.     exit 1
  16. fi
  17.  
  18. . ${SCRIPT_DIR}/install.defaults
  19.  
  20. REQDBINS="grep sed cpio gzip cut head tail who"
  21. OKJAVA="1.5 1.6 1.7"
  22.  
  23. TARGETDIR=/usr/local/${DIR_BASENAME}
  24. BINSDIR=/usr/local/bin
  25. MANIFESTDIR=/usr/local/var/${DIR_BASENAME}
  26. INITDIR=/etc/init.d
  27. RUNLEVEL=`who -r | sed -e 's/^.*\(run-level [0-9]\).*$/\1/' | cut -d \  -f 2`
  28. RUNLVLDIR=/etc/rc${RUNLEVEL}.d
  29.  
  30. SRC_USER=${SUDO_USER}
  31. if [ "x${SRC_USER}" == "x" ] ; then
  32.     SRC_USER=${USER}
  33. fi
  34.  
  35. USERNAME="`id -un`"
  36.  
  37. prepdir() {
  38.     if [ ! -d "${1}" ] ; then
  39.         echo -n "${1} does not exist.  Create $1? (y/n) [y] "
  40.         read YN_PD
  41.         if [ "x${YN_PD}" == "x" ] ; then
  42.             YN_PD=y
  43.         fi
  44.         if [ "${YN_PD}" == "y" ] ; then
  45.             mkdir -p "${1}"
  46.             if [ $? -ne 0 ] ; then
  47.                 echo "Failed to create ${1}.  Please check your configuration."
  48.                 return 1
  49.             fi
  50.         else
  51.             echo "Please check your configuration."
  52.             return 1
  53.         fi
  54.     fi
  55.     return 0
  56. }
  57.  
  58. promptForJVMDownload() {
  59.  
  60.     echo -n "Would you like to download the JRE and dedicate it to ${APP_BASENAME}? (y/n) [y] "
  61.     read JAVADL
  62.     if [ "x${JAVADL}" == "x" ] ; then
  63.         JAVADL=y
  64.     fi
  65.  
  66.     if [ "${JAVADL}" == "y" ] ; then
  67.         JAVACOMMON="DOWNLOAD"
  68.         echo "  jre will be downloaded"
  69.     else
  70.         echo ""
  71.         echo "We're sorry, ${APP_BASENAME} requires a valid Sun JRE or OpenJDK. Please install one and then"
  72.         echo "rerun this installer. Exiting."
  73.         exit 1
  74.     fi
  75.     return 0
  76. }
  77.  
  78. # welcome- avoid printing duplicate messages if we're recalling ourself
  79. if [ "${1}" != "recall" ] ; then
  80.     echo ""
  81.     echo "Welcome to the ${APP_BASENAME} Installer."
  82.     echo ""
  83.     echo -n "Press enter to continue with installation. "
  84.     read ENTER
  85.    
  86.     # Basic requirements -
  87.     echo ""
  88.     echo "Validating environment..."
  89. fi
  90.  
  91. # Basic requirements
  92. if [ "${USERNAME}" != "root" ] ; then
  93.     echo ""
  94.     echo "NOTE: You are apparently not installing as root. While it is recommended to"
  95.     echo "install as root it is not required. If you continue to install as ${USERNAME}"
  96.     echo "then ${APP_BASENAME} will only be able to back up files readable by ${USERNAME}."
  97.     echo ""
  98.     echo -n "Would you like to switch users and install as root? (y/n) [y] "
  99.     read YN
  100.     if [ "x${YN}" == "x" ] ; then
  101.         YN=y
  102.     fi
  103.    
  104.     if [ "${YN}" == "y" ] ; then
  105.         echo "  switching to root"
  106.         sudo ${0} recall
  107.         exit 0
  108.     else
  109.         echo "  installing as current user"
  110.        
  111.         TARGETDIR=${HOME}/${DIR_BASENAME}
  112.         BINSDIR=
  113.         MANIFESTDIR=${TARGETDIR}/manifest
  114.         INITDIR=
  115.         RUNLVLDIR=
  116.     fi
  117. else
  118.     echo "  detected root permissions"
  119. fi
  120.  
  121. # ===============================================================================
  122. # Validate the environment by verifying that all necessary binaries are present
  123. # ===============================================================================
  124. for BIN in $REQDBINS ; do
  125.  
  126.     BIN_PATH=`which $BIN 2> /dev/null`
  127.     if [[ $? != 0 ]]; then
  128.         echo "ERROR: $BIN not found and is required for install. Exiting"
  129.         exit 1
  130.     fi
  131. done
  132. #echo ""
  133.  
  134. # ===============================================================================
  135. # Continue validation by verifying the existence of a supported Java VM
  136. # ===============================================================================
  137. JAVACOMMON=`which java`
  138. if [[ $? != 0 ]]; then
  139.     echo "No Java VM could be found in your path"
  140.     promptForJVMDownload
  141. fi
  142.  
  143.  
  144. # Setup ARCHIVE var to point to the cpio archive.  This will be used here to extract what we need
  145. # to execute the Java comparison below and will be used later by the script to
  146. # actually extract everything.
  147. ARCHIVE=`ls ./*_*.cpi`
  148.  
  149. if [[ $JAVACOMMON != "DOWNLOAD" ]]; then
  150.  
  151.     # Evaluate the Java environment
  152.     mkdir ./lib
  153.     cat $ARCHIVE | gzip -dc - | cpio -i --no-preserve-owner ./lib/com.backup42.desktop.jar
  154.     $JAVACOMMON -classpath ./lib/com.backup42.desktop.jar com.code42.utils.JavaEnvironment > /tmp/foo.sh
  155.     source /tmp/foo.sh
  156.     rm /tmp/foo.sh
  157.     rm -rf ./lib
  158.    
  159.     # Check the Java version to make sure we have something workable
  160.     JAVAVERCHECK=0
  161.     for CANDIDATE in $OKJAVA; do
  162.         if [[ $CANDIDATE == $JAVA_SPECIFICATION_VERSION ]] ; then
  163.             JAVAVERCHECK=1
  164.         fi
  165.     done
  166.     if [[ $JAVAVERCHECK -eq 0 ]]; then
  167.         echo "The current version of Java ($JAVA_SPECIFICATION_VERSION) is incompatible with $APP_BASENAME."
  168.         echo "Please install one of the following version of the Sun JRE or OpenJDK: $OKJAVA"
  169.         exit 1
  170.     fi 
  171.    
  172.     # Make sure we've got either HotSpot or OpenJDK
  173.     echo $JAVA_VM_NAME | grep OpenJDK > /dev/null 2>&1
  174.     IS_OPENJDK=$?
  175.     echo $JAVA_VM_NAME | grep HotSpot > /dev/null 2>&1
  176.     IS_HOTSPOT=$?
  177.     if [[ ! ($IS_OPENJDK || $IS_HOTSPOT) ]]; then
  178.         echo ""
  179.         echo "The current installed version of Java is not supported."
  180.         echo "$APP_BASENAME requires the Sun JRE or OpenJDK."
  181.         exit 1
  182.     fi
  183. fi
  184.  
  185.  
  186. echo ""
  187. echo "You must review and agree to the EULA before installation."
  188. echo ""
  189. echo -n "Press enter to read the EULA. "
  190. read ENTER
  191.  
  192. # EULA Time
  193. more ./EULA.txt
  194.  
  195. agreed=0
  196. while [ "${agreed}" == "0" ] ; do
  197.     echo ""
  198.     echo -n "Do you accept and agree to be bound by the EULA? (yes/no) "
  199.     read reply
  200.     case ${reply} in
  201.         [yY] | [yY][eE][sS])
  202.             agreed=1
  203.             ;;
  204.         [nN] | [nN][oO])
  205.             echo "If you do not agree to the license then ${APP_BASENAME} may not be installed. Exiting.";
  206.             exit 1
  207.             ;;
  208.     esac
  209. done
  210.  
  211.  
  212. INTERVIEW=0
  213. while [ ${INTERVIEW} == 0 ] ; do
  214.  
  215.     INTERVIEWSUB=0
  216.     while [ ${INTERVIEWSUB} == 0 ] ; do
  217.         echo ""
  218.         echo -n "What directory do you wish to install ${APP_BASENAME} to? [${TARGETDIR}] "
  219.         read TARGETDIR_X       
  220.         if [ "x${TARGETDIR_X}" != "x" ] ; then
  221.             TARGETDIR=${TARGETDIR_X}
  222.             MANIFESTDIR=${TARGETDIR}/manifest
  223.         fi
  224.        
  225.         prepdir "${TARGETDIR}"
  226.         if [ $? == 0 ] ; then
  227.             INTERVIEWSUB=1
  228.         fi
  229.     done
  230.        
  231.  
  232.     if [ "${USERNAME}" == "root" ] ; then
  233.         INTERVIEWSUB=0
  234.         while [ ${INTERVIEWSUB} == 0 ] ; do
  235.             echo ""
  236.             echo -n "What directory do you wish to link the ${APP_BASENAME} executable to? [${BINSDIR}] "
  237.             read BINSDIR_X
  238.             if [ "x${BINSDIR_X}" != "x" ] ; then
  239.                 BINSDIR=${BINSDIR_X}
  240.             fi
  241.             prepdir ${BINSDIR}
  242.             if [ $? == 0 ] ; then
  243.                 INTERVIEWSUB=1
  244.             fi
  245.         done
  246.     fi
  247.  
  248.     INTERVIEWSUB=0
  249.     while [ ${INTERVIEWSUB} == 0 ] ; do
  250.         echo ""
  251.         echo -n "What directory do you wish to store backups in? [${MANIFESTDIR}] "
  252.         read MANIFESTDIR_X
  253.         if [ "x${MANIFESTDIR_X}" != "x" ] ; then
  254.             MANIFESTDIR=${MANIFESTDIR_X}
  255.         fi
  256.         prepdir ${MANIFESTDIR}
  257.         if [ $? == 0 ] ; then
  258.             INTERVIEWSUB=1
  259.         fi
  260.     done
  261.  
  262.     if [ "${USERNAME}" == "root" ] ; then
  263.         INTERVIEWSUB=0
  264.         while [ ${INTERVIEWSUB} == 0 ] ; do
  265.             echo ""
  266.             echo -n "What directory contains your SYSV init scripts? [${INITDIR}] "
  267.             read INITDIR_X
  268.             if [ "x${INITDIR_X}" != "x" ] ; then
  269.                 INITDIR=${INITDIR_X}
  270.             fi
  271.             prepdir ${INITDIR}
  272.             if [ $? == 0 ] ; then
  273.                 INTERVIEWSUB=1
  274.             fi
  275.         done
  276.  
  277.         INTERVIEWSUB=0
  278.         while [ ${INTERVIEWSUB} == 0 ] ; do
  279.             echo ""
  280.             echo -n "What directory contains your runlevel init links? [${RUNLVLDIR}] "
  281.             read RUNLVLDIR_X
  282.             if [ "x${RUNLVLDIR_X}" != "x" ] ; then
  283.                 RUNLVLDIR=${RUNLVLDIR_X}
  284.             fi
  285.             prepdir ${RUNLVLDIR}
  286.             if [ $? == 0 ] ; then
  287.                 INTERVIEWSUB=1
  288.             fi
  289.         done
  290.     fi
  291.     echo ""
  292.     echo "Your selections:"
  293.     echo ${APP_BASENAME} will install to: ${TARGETDIR}
  294.     if [ "${USERNAME}" == "root" ] ; then
  295.         echo And put links to binaries in: ${BINSDIR}
  296.     fi
  297.     echo And store datas in: ${MANIFESTDIR}
  298.     if [ "${USERNAME}" == "root" ] ; then
  299.         echo Your init.d dir is: ${INITDIR}
  300.         echo Your current runlevel directory is: ${RUNLVLDIR}
  301.     fi
  302.     echo ""
  303.     echo -n "Is this correct? (y/n) [y] "
  304.     read YN
  305.     if [ "x${YN}" == "x" ] ; then
  306.         YN=y
  307.     fi
  308.  
  309.     if [ "${YN}" == "y" ] ; then
  310.         INTERVIEW=1
  311.     fi
  312. done
  313.  
  314. # INSTALL TIME ===============================================
  315. echo ""
  316.  
  317. # is crashplan already there?
  318. if [ -f ${TARGETDIR}/install.vars ]; then
  319.     echo "CrashPlan appears to already be installed in the specified location:"
  320.     echo "  ${TARGETDIR}"
  321.     echo "Please uninstall and then try this install again."
  322.     exit 1
  323. fi
  324.  
  325. # create a file that has our install vars so we can later uninstall
  326. echo "" > ${TARGETDIR}/install.vars
  327. echo "TARGETDIR=${TARGETDIR}" >> ${TARGETDIR}/install.vars
  328. echo "BINSDIR=${BINSDIR}" >> ${TARGETDIR}/install.vars
  329. echo "MANIFESTDIR=${MANIFESTDIR}" >> ${TARGETDIR}/install.vars
  330. echo "INITDIR=${INITDIR}" >> ${TARGETDIR}/install.vars
  331. echo "RUNLVLDIR=${RUNLVLDIR}" >> ${TARGETDIR}/install.vars
  332. NOW=`date +%Y%m%d`
  333. echo "INSTALLDATE=$NOW" >> ${TARGETDIR}/install.vars
  334. cat ${SCRIPT_DIR}/install.defaults >> ${TARGETDIR}/install.vars
  335.  
  336. # keep track of the processor architecture
  337. PARCH=`uname -m`
  338.    
  339. #download java
  340. if [[ $JAVACOMMON == "DOWNLOAD" ]]; then
  341.     if [[ $PARCH == "x86_64" ]]; then
  342.         JVMURL="http://${DOWNLOAD_HOST}/linuxjvm/jre1.6.0_25_x64.tgz"
  343.     else
  344.         JVMURL="http://${DOWNLOAD_HOST}/linuxjvm/jre1.6.0_25_i586.tgz"
  345.     fi
  346.     JVMFILE=`basename ${JVMURL}`
  347.     if [[ -f ${JVMFILE} ]]; then
  348.         echo ""
  349.         echo "Download of the JVM found. We'll try to use it, but if it's only a partial"
  350.         echo "copy of the file then this will fail. If that happens please remove the file"
  351.         echo "and try again."
  352.         echo "JRE Archive: ${JVMFILE}"
  353.         echo ""
  354.     else
  355.    
  356.         # Start by looking for wget
  357.         WGET_PATH=`which wget 2> /dev/null`
  358.         if [[ $? == 0 ]]; then
  359.             echo "    downloading the JRE using wget"
  360.             $WGET_PATH $JVMURL
  361.             if [[ $? != 0 ]]; then
  362.                 echo "Unable to download JRE; please check network connection"
  363.                 exit 1
  364.             fi
  365.         else
  366.  
  367.             CURL_PATH=`which curl 2> /dev/null`
  368.             if [[ $? == 0 ]]; then
  369.                 echo "    downloading the JRE using curl"
  370.                 $CURL_PATH $JVMURL -o `basename $JVMURL`
  371.                 if [[ $? != 0 ]]; then
  372.                     echo "Unable to download JRE; please check network connection"
  373.                     exit 1
  374.                 fi
  375.             else
  376.                 echo "Could not find wget or curl.  You must install one of these utilities"
  377.                 echo "in order to download a JVM"
  378.                 exit 1
  379.             fi
  380.         fi
  381.     fi
  382.  
  383.     HERE=`pwd`
  384.     cd ${TARGETDIR}
  385.     # Extract into ./jre
  386.     tar -xzf "${HERE}/${JVMFILE}"
  387.     cd "${HERE}"
  388.     echo "JAVACOMMON=${TARGETDIR}/jre/bin/java" >> ${TARGETDIR}/install.vars
  389.     echo "Java Installed."
  390. else
  391.     echo "JAVACOMMON=${JAVACOMMON}" >> ${TARGETDIR}/install.vars
  392. fi 
  393.  
  394. # Definition of ARCHIVE occurred above when we extracted the JAR we need to evaluate Java environment
  395. echo Unpacking ${HERE}/${ARCHIVE} ...
  396. HERE=`pwd`
  397. cd ${TARGETDIR}
  398. cat "${HERE}/${ARCHIVE}" | gzip -d -c - | cpio -i --no-preserve-owner
  399. cd "${HERE}"
  400.  
  401. # custom?
  402. if [ -d .Custom ]; then
  403.   echo Copying .Custom to ${TARGETDIR}
  404.   cp -Rp .Custom "${TARGETDIR}"
  405. fi
  406. if [ -d custom ]; then
  407.   echo Copying custom to ${TARGETDIR}
  408.   cp -Rp custom "${TARGETDIR}"
  409. fi
  410. if [ -d Custom ]; then
  411.   echo Copying custom to ${TARGETDIR}
  412.   cp -Rp custom "${TARGETDIR}"
  413. fi
  414.  
  415. #update the configs for file storage
  416. if grep "<manifestPath>.*</manifestPath>" ${TARGETDIR}/conf/default.service.xml > /dev/null
  417.     then
  418.         sed -i "s|<manifestPath>.*</manifestPath>|<manifestPath>${MANIFESTDIR}</manifestPath>|g" ${TARGETDIR}/conf/default.service.xml
  419.     else
  420.         sed -i "s|<backupConfig>|<backupConfig>\n\t\t\t<manifestPath>${MANIFESTDIR}</manifestPath>|g" ${TARGETDIR}/conf/default.service.xml
  421. fi
  422.  
  423. # the log dir
  424. LOGDIR=${TARGETDIR}/log
  425. chmod 777 $LOGDIR
  426.  
  427. # desktop init script
  428. GUISCRIPT=${TARGETDIR}/bin/${APP_BASENAME}Desktop
  429. cp scripts/${APP_BASENAME}Desktop ${GUISCRIPT}
  430. chmod 755 ${GUISCRIPT}
  431. #sed -imod "s|TARGETDIR=.*|TARGETDIR=${TARGETDIR}|" ${GUISCRIPT} && rm -rf ${GUISCRIPT}mod
  432.  
  433. # link to bin if appropriate
  434. if [ "x${BINSDIR}" != "x" ] ; then
  435.     ln -s ${GUISCRIPT} ${BINSDIR}/${APP_BASENAME}Desktop
  436. fi
  437.  
  438.  
  439. # Install the control script for the service
  440. INITSCRIPT=${TARGETDIR}/bin/${APP_BASENAME}Engine
  441. cp scripts/${APP_BASENAME}Engine ${INITSCRIPT}
  442. cp scripts/run.conf ${TARGETDIR}/bin
  443. chmod 755 ${INITSCRIPT}
  444.  
  445. # Install the init script and modify it by applying variables currently defined in this context
  446. # If the user is not installing as root then we install into the bin directory only.
  447. INIT_INSTALL_DIR=${TARGETDIR}/bin
  448. if [ "x${INITDIR}" != "x" ] ; then
  449.    INIT_INSTALL_DIR=${INITDIR}
  450. fi
  451.    
  452. # Perform substitution on the init script; we need to make the value of INITSCRIPT available
  453. # to what lives in /etc/init.d
  454. SEDEXPRSUB=`echo $INITSCRIPT | sed 's/\//\\\\\//g'`
  455. SEDEXPR="s/<INITSCRIPT>/$SEDEXPRSUB/g"
  456. sed $SEDEXPR scripts/${DIR_BASENAME} > ${INIT_INSTALL_DIR}/${DIR_BASENAME}
  457. chmod 755 ${INIT_INSTALL_DIR}/${DIR_BASENAME}
  458.  
  459. if [ "x${RUNLVLDIR}" != "x" ] ; then
  460.  
  461.    # Now that we should have a working init script let's link in the runlevel scripts  
  462.    ln -s ${INIT_INSTALL_DIR}/${DIR_BASENAME} ${RUNLVLDIR}/S99${DIR_BASENAME}
  463. fi
  464.  
  465.  
  466. # copy the desktop launcher into place
  467. if [ -d "/home/${SRC_USER}/Desktop" ] ; then
  468.     DESKTOP_LAUNCHER="/home/${SRC_USER}/Desktop/${APP_BASENAME}.desktop"
  469.    
  470.     # which icon are we using? custom if it exists
  471.     DESKTOP_ICON_PATH=${TARGETDIR}/skin/icon_app_128x128.png
  472.     if [ -f ${TARGETDIR}/skin/custom/icon_app_64x64.png ] ; then
  473.         DESKTOP_ICON_PATH=${TARGETDIR}/skin/custom/icon_app_64x64.png
  474.     fi
  475.     if [ -f ${TARGETDIR}/skin/custom/icon_app_128x128.png ] ; then
  476.         DESKTOP_ICON_PATH=${TARGETDIR}/skin/custom/icon_app_128x128.png
  477.     fi
  478.    
  479.     # use 'su' only if we're operating as root
  480.     if [ "${USERNAME}" == "root" ] ; then
  481.         su ${SRC_USER} -c "cp scripts/${APP_BASENAME}.desktop ${DESKTOP_LAUNCHER}"
  482.         su ${SRC_USER} -c "chmod +x ${DESKTOP_LAUNCHER}"
  483.         su ${SRC_USER} -c "sed -imod \"s|Exec=.*|Exec=${GUISCRIPT}|\" ${DESKTOP_LAUNCHER} && rm -rf ${DESKTOP_LAUNCHER}mod"
  484.         su ${SRC_USER} -c "sed -imod \"s|Icon=.*|Icon=${DESKTOP_ICON_PATH}|\" ${DESKTOP_LAUNCHER} && rm -rf ${DESKTOP_LAUNCHER}mod"
  485.     else
  486.         cp scripts/${APP_BASENAME}.desktop ${DESKTOP_LAUNCHER}
  487.         chmod +x ${DESKTOP_LAUNCHER}
  488.         sed -imod "s|Exec=.*|Exec=${GUISCRIPT}|" ${DESKTOP_LAUNCHER} && rm -rf ${DESKTOP_LAUNCHER}mod
  489.         sed -imod "s|Icon=.*|Icon=${DESKTOP_ICON_PATH}|" ${DESKTOP_LAUNCHER} && rm -rf ${DESKTOP_LAUNCHER}mod
  490.     fi
  491. fi
  492.  
  493. # Check for max_user_watches and suggest updating if necessary.  Many distros use 8192 by default
  494. # so we use this value as a baseline.
  495. INOTIFY_WATCHES=`cat /proc/sys/fs/inotify/max_user_watches`
  496. if [[ $INOTIFY_WATCHES -le 8192 ]]; then
  497.   echo ""
  498.   echo "Your Linux system is currently configured to watch $INOTIFY_WATCHES files in real time."
  499.   echo "We recommend using a larger value; see the CrashPlan support site for details"
  500.   echo ""
  501. fi
  502.  
  503. # Start the servce
  504. ${INITSCRIPT} start
  505.  
  506. # call out the "service has been started" by creating a pause
  507. echo ""
  508. echo "${APP_BASENAME} has been installed and the Service has been started automatically."
  509. echo ""
  510. echo -n "Press Enter to complete installation. "
  511. read ENTER
  512.  
  513. echo ""
  514. echo "Important directories:"
  515. echo "  Installation:"
  516. echo "    ${TARGETDIR}"
  517. echo "  Logs:"
  518. echo "    ${TARGETDIR}/log"
  519. echo "  Default archive location:"
  520. echo "    ${MANIFESTDIR}"
  521.  
  522. # if we installed as root make sure they see 'sudo' in front of the Engine start
  523. SUDO_PREFIX="sudo "
  524. if [ "${USERNAME}" != "root" ] ; then
  525.     SUDO_PREFIX=""
  526. fi
  527. echo ""
  528. echo "Start Scripts:"
  529. echo "  ${SUDO_PREFIX}${INITSCRIPT} start|stop"
  530. echo "  ${GUISCRIPT}"
  531.  
  532. echo ""
  533. echo "You can run the ${APP_BASENAME} Desktop UI locally as your own user or connect"
  534. echo "a remote Desktop UI to this Service via port-forwarding and manage it"
  535. echo "remotely. Instructions for remote management are in the readme files"
  536. echo "placed in your installation directory:"
  537. echo "  ${TARGETDIR}/doc"
  538. echo ""
  539. if [ "x${DISPLAY}" != "x" ] ; then
  540.     echo -n "Would you like to start ${APP_BASENAME}Desktop? (y/n) [y] "
  541.     read reply
  542.     if [ "x${reply}" == "x" ] ; then
  543.         reply=y
  544.     fi
  545.     case ${reply} in
  546.         [yY] | [yY][eE][sS])
  547.             # use 'su' only if we're operating as root
  548.             if [ "${USERNAME}" == "root" ] ; then
  549.                 su ${SRC_USER} -c "${GUISCRIPT}"
  550.             else
  551.                 ${GUISCRIPT}
  552.             fi
  553.             ;;
  554.     esac
  555. fi
  556.  
  557. echo ""
  558. echo "To start the Desktop UI:"
  559. if [ "x${BINSDIR}" != "x" ] ; then
  560.     echo "  ${BINSDIR}/${APP_BASENAME}Desktop"
  561. else
  562. echo "  ${GUISCRIPT}"
  563. fi
  564.  
  565. echo ""
  566. echo "Installation is complete. Thank you for installing ${APP_BASENAME} for Linux."
  567. echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement