From: Marco Zanon Date: Sat, 8 Sep 2012 13:55:22 +0000 (+0000) Subject: Moved configuration directives into an external file. X-Git-Tag: 0.4~5 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=4bb26d72b36c5516f1350c5e5b7f1be9e85a0e3e;p=single_click_remote_help Moved configuration directives into an external file. --- diff --git a/build.sh b/build.sh index 53f2fc4..c81b0d9 100755 --- a/build.sh +++ b/build.sh @@ -4,9 +4,16 @@ ## Copyright (c) 2012 Marco Zanon . ## Released under GPLv2 license (see LICENSE for details). +S1=`awk '/^__CONFIGURATION_DIRECTIVES__/ { print NR - 1; exit 0; }' skeleton` +C=`awk '/^__CONFIGURATION_DIRECTIVES_BELOW__/ { print NR + 1; exit 0; }' config` +S2=`awk '/^__CONFIGURATION_DIRECTIVES__/ { print NR + 1; exit 0; }' skeleton` +head -n $S1 skeleton > single_click_remote_help.sh +tail -n+$C config.sample >> single_click_remote_help.sh +tail -n+$S2 skeleton >> single_click_remote_help.sh + tar --directory package/ --exclude-vcs -czf package.tar.gz . +cat package.tar.gz >> single_click_remote_help.sh -cat skeleton package.tar.gz > single_click_remote_help.sh chmod 755 single_click_remote_help.sh rm package.tar.gz diff --git a/config.sample b/config.sample new file mode 100644 index 0000000..1c17e08 --- /dev/null +++ b/config.sample @@ -0,0 +1,18 @@ +#!/bin/bash + +## single_click_remote_help skeleton +## Copyright (c) 2012 Marco Zanon . +## Released under GPLv2 license (see LICENSE for details). +## +## Configuration directives. + +__CONFIGURATION_DIRECTIVES_BELOW__ +SINGLE_CLICK_REMOTE_HELP_VERSION="0.x" +VNC_SERVER="x11vnc-0.9.13_amd64-Linux" +INPUT_BOX_TITLE="__YOUR_TEXT_HERE__" +INPUT_BOX_MESSAGE="__YOUR_TEXT_HERE__" +LABEL_COLUMN_TITLE="__YOUR_TEXT_HERE__" +CONNECTIONS[0]="__YOUR_LABEL_HERE__|__YOUR_VNC_SERVER_COMMAND_ARGUMENTS_HERE__" +CONNECTIONS[1]="__YOUR_LABEL_HERE__|__YOUR_VNC_SERVER_COMMAND_ARGUMENTS_HERE__" +CLIENT_CONNECTED_MESSAGE="__YOUR_TEXT_HERE__" +CLIENT_GONE_MESSAGE="__YOUR_TEXT_HERE__" diff --git a/skeleton b/skeleton index 74df168..f05f1d1 100644 --- a/skeleton +++ b/skeleton @@ -19,15 +19,7 @@ ## 7 Vnc connection error. ## 1. Define constants. -SINGLE_CLICK_REMOTE_HELP_VERSION="0.x" -VNC_SERVER="x11vnc-0.9.13_amd64-Linux" -INPUT_BOX_TITLE="__YOUR_TEXT_HERE__" -INPUT_BOX_MESSAGE="__YOUR_TEXT_HERE__" -LABEL_COLUMN_TITLE="__YOUR_TEXT_HERE__" -CONNECTIONS[0]="__YOUR_LABEL_HERE__|__YOUR_VNC_SERVER_COMMAND_ARGUMENTS_HERE__" -CONNECTIONS[1]="__YOUR_LABEL_HERE__|__YOUR_VNC_SERVER_COMMAND_ARGUMENTS_HERE__" -CLIENT_CONNECTED_MESSAGE="__YOUR_TEXT_HERE__" -CLIENT_GONE_MESSAGE="__YOUR_TEXT_HERE__" +__CONFIGURATION_DIRECTIVES__ ## 2. Evaluate command line arguments. if [ -n "$1" ]; then