Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,390 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ Network: | |
- mangler* | ||
- mumble* | ||
- murmur* | ||
- znc** | ||
- supybot | ||
|
||
Office: | ||
- libreoffice | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Supybot is an easy to configure and highly flexible IRC bot written | ||
in the python scripting language. | ||
|
||
To use a different supybot user: | ||
# SUPYBOT_USER=user ./supybot.SlackBuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
config() { | ||
NEW="$1" | ||
OLD="$(dirname $NEW)/$(basename $NEW .new)" | ||
# If there's no config file by that name, mv it over: | ||
if [ ! -r $OLD ]; then | ||
mv $NEW $OLD | ||
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then | ||
# toss the redundant copy | ||
rm $NEW | ||
fi | ||
# Otherwise, we leave the .new copy for the admin to consider... | ||
} | ||
|
||
preserve_perms() { | ||
NEW="$1" | ||
OLD="$(dirname $NEW)/$(basename $NEW .new)" | ||
if [ -e $OLD ]; then | ||
cp -a $OLD ${NEW}.incoming | ||
cat $NEW > ${NEW}.incoming | ||
mv ${NEW}.incoming $NEW | ||
fi | ||
config $NEW | ||
} | ||
|
||
config etc/supybot/supybot.conf.new | ||
preserve_perms etc/rc.d/rc.supybot.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
SUPYBOT_USER=${SUPYBOT_USER:-@SUPYBOT_USER@} | ||
SUPYBOT_CONFIG=${SUPYBOT_CONFIG:-/etc/supybot/supybot.conf} | ||
|
||
supybot_start() | ||
{ | ||
pid=$(pgrep -U $SUPYBOT_USER supybot) | ||
|
||
if [ -n "$pid" ]; then | ||
echo "Supybot is already running" | ||
exit 1 | ||
fi | ||
|
||
su - $SUPYBOT_USER -c "/usr/bin/supybot $SUPYBOT_CONFIG -d" | ||
} | ||
|
||
supybot_stop() | ||
{ | ||
pid=$(pgrep -U $SUPYBOT_USER supybot) | ||
|
||
if [ -z "$pid" ]; then | ||
echo "Supybot is not running" | ||
exit 1 | ||
fi | ||
|
||
kill $pid | ||
} | ||
|
||
supybot_restart() | ||
{ | ||
supybot_stop | ||
sleep 1 | ||
supybot_start | ||
} | ||
|
||
case "$1" in | ||
start) | ||
supybot_start ;; | ||
stop) | ||
supybot_stop ;; | ||
restart) | ||
supybot_restart ;; | ||
*) | ||
echo "usage: $0 start|stop|restart" | ||
esac |
Oops, something went wrong.