From: Marco Zanon <info@marcozanon.com>
Date: Sat, 8 Sep 2012 13:55:22 +0000 (+0000)
Subject: Moved configuration directives into an external file.
X-Git-Tag: SVN-to-Git~13
X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=a9f271b3e02f2cad96d51fa269980d0619453334;p=single_click_remote_help

Moved configuration directives into an external file.
---

diff --git a/0.x/build.sh b/0.x/build.sh
index 53f2fc4..c81b0d9 100755
--- a/0.x/build.sh
+++ b/0.x/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/0.x/config.sample b/0.x/config.sample
new file mode 100644
index 0000000..1c17e08
--- /dev/null
+++ b/0.x/config.sample
@@ -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__"
diff --git a/0.x/skeleton b/0.x/skeleton
index 74df168..f05f1d1 100644
--- a/0.x/skeleton
+++ b/0.x/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