testbot/scripts: Remove the hardcoded path and username.

Francois Gouget fgouget at codeweavers.com
Mon Oct 29 09:53:38 CDT 2012


Instead, fail if they are not set and tell the user to either put them in the script or in the standard /etc/default directory.
---
 testbot/scripts/initd |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/testbot/scripts/initd b/testbot/scripts/initd
index bffc26d..262fa54 100755
--- a/testbot/scripts/initd
+++ b/testbot/scripts/initd
@@ -33,8 +33,18 @@
 # Description:       Start winetestbot to start job processing
 ### END INIT INFO
 
-USER="winehq"
-WTB_ROOT="/home/winehq/tools/testbot"
+USER=
+WTB_ROOT=
+if [ \( -z "$USER" -o -z "$WTB_ROOT" \) -a -f "/etc/default/winetestbot" ]
+then
+    . /etc/default/winetestbot
+fi
+if [ -z "$USER" -o -z "$WTB_ROOT" ]
+then
+    echo "Set the username and WineTestBot root in the init.d script or in /etc/default/winetestbot" >&2
+    exit 1
+fi
+
 DAEMON="$WTB_ROOT/bin/Engine.pl"
 PING="$WTB_ROOT/bin/PingEngine.pl"
 PIDFILE="/var/run/winetestbot.pid"
-- 
1.7.10.4



More information about the wine-patches mailing list