From: Marco Zanon Date: Tue, 13 Mar 2012 21:46:15 +0000 (+0000) Subject: Swapped if arguments. X-Git-Tag: 0.3~5 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=cca1e720304f1128e8e0d56275a80001e9b23edf;p=single_click_remote_help Swapped if arguments. --- diff --git a/skeleton b/skeleton index ab31e9c..159dde6 100644 --- a/skeleton +++ b/skeleton @@ -56,7 +56,7 @@ echo "Vnc server command arguments: $VNC_SERVER_COMMAND_ARGUMENTS." ## 3. Create temporary directory. TEMPORARY_DIRECTORY=`mktemp -d /tmp/single_click_remote_help.XXXXXXXXXX` -if [ "$?" -ne "0" ]; then +if [ "0" -ne "$?" ]; then echo "Temporary directory not created, exiting." exit 2 fi @@ -65,13 +65,13 @@ echo "Temporary directory created: $TMP_DIR." ## 4. Extract Vnc server binary and make it executable. BINARY_LINES=`awk '/^__BINARY_BELOW__/ { print NR + 1; exit 0; }' $0` tail -n+$BINARY_LINES $0 > $TEMPORARY_DIRECTORY/vncserver -if [ "$?" -ne "0" ]; then +if [ "0" -ne "$?" ]; then echo "Vnc server binary not extracted, exiting." exit 3 fi echo "Vnc server binary extracted." chmod +x $TEMPORARY_DIRECTORY/vncserver -if [ "$?" -ne "0" ]; then +if [ "0" -ne "$?" ]; then echo "Execution permission not set, exiting." exit 4 fi @@ -80,7 +80,7 @@ echo "Execution permission set." ## 5. Run Vnc server. echo "Starting Vnc server." $TEMPORARY_DIRECTORY/vncserver $VNC_SERVER_COMMAND_ARGUMENTS -if [ "$?" -ne "0" ]; then +if [ "0" -ne "$?" ]; then echo "Vnc connection error, exiting." exit 5 fi