Browse Source

move ffpb.cfg to bot.cfg.example and require usage of 'bot.cfg'

Helge Jung 10 years ago
parent
commit
a5cee3bfb5
3 changed files with 13 additions and 3 deletions
  1. 1 0
      .gitignore
  2. 5 1
      bot.cfg.example
  3. 7 2
      bot.sh

+ 1 - 0
.gitignore

@@ -1,5 +1,6 @@
 *.sqlite
 *.pid
 *.pyc
+bot.cfg
 build/
 logs/

+ 5 - 1
ffpb.cfg → 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

+ 7 - 2
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)