From b0d3227ba754d2631fd6a99d64107dcf4cdd4684 Mon Sep 17 00:00:00 2001 From: Christian Pierre MOMON Date: Wed, 11 Mar 2020 03:38:42 +0100 Subject: [PATCH] Externalized welcomebot configuraiton file (#4286). --- .gitignore | 1 + bot_settings-example.py | 21 +++++++++++++++++++++ bot_settings.py | 22 +--------------------- bot.py => welcomebot.py | 0 welcomebot.service | 2 +- bot.sh => welcomebot.sh | 2 +- 6 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 bot_settings-example.py mode change 100644 => 120000 bot_settings.py rename bot.py => welcomebot.py (100%) rename bot.sh => welcomebot.sh (73%) diff --git a/.gitignore b/.gitignore index 922dd0b..506382d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ bin error.log nohup.out nicks.csv +bot_settings.py diff --git a/bot_settings-example.py b/bot_settings-example.py new file mode 100644 index 0000000..156437f --- /dev/null +++ b/bot_settings-example.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -1 -*- +# Replace these default settings with your own personal settings + +# IRC configuration +channel = "#april-accueil" +botnick = "bot_d_accueil" +server = "irc.freenode.net" +registered = False + +# Bot behavior +wait_time = 60 +channel_greeters = ["madix", "cioccolisa", "cpm_screen", "lonugem" ] +nick_source = "nicks.csv" + +# Bot text +hello_list = ["hello", "yo", "bonjour", "salut"] +help_list = ["help", "info", "faq", "explain_yourself", "aide"] + +# Bot welcome message. In fact, never used. +welcome_message = "Welcome! The channel is pretty quiet right now, so I thought I'd say hello, and ping some people that you're here. If no one responds for a whle, try emailing us at contact@april.org or just try coming back later. FYI, you're now on my list of known nicknames, so I won't bother you again." + diff --git a/bot_settings.py b/bot_settings.py deleted file mode 100644 index 4b416c8..0000000 --- a/bot_settings.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -1 -*- -# Replace these default settings with your own personal settings - -# IRC configuration -channel = "#april-accueil" -botnick = "bot_d_accueil" -server = "irc.freenode.net" -registered = False - -# Bot behavior -wait_time = 60 -channel_greeters = ["madix", "cioccolisa", "cpm__", "lonugem" ] -nick_source = "nicks.csv" - -# Bot text -hello_list = ["hello", "yo", "bonjour", "salut"] -help_list = ["help", "info", "faq", "explain_yourself", "aide"] - -# Bot welcome message. In fact, never used. -welcome_message = "Welcome! The channel is pretty quiet right now, so I thought I'd say hello, and ping some people that you're here. If no one responds for a whle, try emailing us at contact@april.org or just try coming back later. FYI, you're now on my list of known nicknames, so I won't bother you again." - diff --git a/bot_settings.py b/bot_settings.py new file mode 120000 index 0000000..f7d5ce3 --- /dev/null +++ b/bot_settings.py @@ -0,0 +1 @@ +/etc/welcomebot/bot_settings.py \ No newline at end of file diff --git a/bot.py b/welcomebot.py similarity index 100% rename from bot.py rename to welcomebot.py diff --git a/welcomebot.service b/welcomebot.service index 468d663..e746c7d 100644 --- a/welcomebot.service +++ b/welcomebot.service @@ -5,7 +5,7 @@ After=network-online.target [Service] Type=simple WorkingDirectory=/srv/welcomebot/git -ExecStart=/srv/welcomebot/git/bot.py +ExecStart=/srv/welcomebot/bin/welcomebot.py User=welcomebot Group=welcomebot Restart=always diff --git a/bot.sh b/welcomebot.sh similarity index 73% rename from bot.sh rename to welcomebot.sh index 0093703..b310498 100755 --- a/bot.sh +++ b/welcomebot.sh @@ -10,4 +10,4 @@ cd "$BINDIR" #nohup /srv/welcomebot/git/bot.py >> /dev/null 2>>../welcomebot.log & -nohup "$BINDIR/bot.py" > /dev/null 2>>"$HOMEDIR/welcomebot.log" & +nohup "$BINDIR/welcomebot.py" > /dev/null 2>>"$HOMEDIR/welcomebot.log" &