Moved configuration directives into an external file.
authorMarco Zanon <info@marcozanon.com>
Sat, 8 Sep 2012 13:55:22 +0000 (13:55 +0000)
committerMarco Zanon <info@marcozanon.com>
Sat, 8 Sep 2012 13:55:22 +0000 (13:55 +0000)
build.sh
config.sample [new file with mode: 0644]
skeleton

index 53f2fc49f636f7b1b0cf8b007c9e09a9476d4463..c81b0d96822dd6ff4f195367895784ed52de7a83 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -4,9 +4,16 @@
 ## Copyright (c) 2012 Marco Zanon <info@marcozanon.com>.
 ## 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 (file)
index 0000000..1c17e08
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+## single_click_remote_help skeleton
+## Copyright (c) 2012 Marco Zanon <info@marcozanon.com>.
+## 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__"
index 74df168e8e5ec180041c388a8d784d3edbadd02a..f05f1d1bb4130bf986ef06f373977697f1d8c4c1 100644 (file)
--- a/skeleton
+++ b/skeleton
 ##   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