From a5cee3bfb57bac8eeeefc45fe2067311f51b60cf Mon Sep 17 00:00:00 2001
From: Helge Jung <hej@c3pb.de>
Date: Thu, 19 Jun 2014 16:32:00 +0200
Subject: [PATCH] move ffpb.cfg to bot.cfg.example and require usage of
 'bot.cfg'

---
 .gitignore                  | 1 +
 ffpb.cfg => bot.cfg.example | 6 +++++-
 bot.sh                      | 9 +++++++--
 3 files changed, 13 insertions(+), 3 deletions(-)
 rename ffpb.cfg => bot.cfg.example (84%)

diff --git a/.gitignore b/.gitignore
index eb1d582..a445c5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 *.sqlite
 *.pid
 *.pyc
+bot.cfg
 build/
 logs/
diff --git a/ffpb.cfg b/bot.cfg.example
similarity index 84%
rename from ffpb.cfg
rename to bot.cfg.example
index a569dfb..d047d02 100644
--- a/ffpb.cfg
+++ b/bot.cfg.example
@@ -13,7 +13,7 @@ port = 9999
 owner = HeJ
 admins = oscar-, Barbarossa
 
-channels = #ffpb-gurus, #ffpb
+channels = #ffpb
 prefix = !
 enable = admin,ffpb,ip,reload
 timeout = 120
@@ -26,3 +26,7 @@ pid_dir = .
 userdb_type = sqlite
 userdb_file = ffpb.sqlite
 
+[ffpb]
+msg_enable = 1
+msg_port = 2342
+msg_target = #ffpb
diff --git a/bot.sh b/bot.sh
index e2ca1dd..8040203 100755
--- a/bot.sh
+++ b/bot.sh
@@ -12,14 +12,19 @@ if [ -z "$python3" ]; then
 	fi
 fi
 
+if [ ! -r "${mydir}/bot.cfg" ]; then
+	echo "'bot.cfg' is missing. Have you copied 'bot.cfg.example'?"
+	exit 2
+fi
+
 case $1 in
 	start)
 		[ ! -d "${mydir}/logs" ] && mkdir "${mydir}/logs"
 
-		$python3 "${mydir}/willie/willie.py" -c "${mydir}/ffpb.cfg" --fork
+		$python3 "${mydir}/willie/willie.py" -c "${mydir}/bot.cfg" --fork
 		;;
 	stop)
-		$python3 "${mydir}/willie/willie.py" -c "${mydir}/ffpb.cfg" --quit
+		$python3 "${mydir}/willie/willie.py" -c "${mydir}/bot.cfg" --quit
 		;;
 
 	restart)
-- 
GitLab