-
Notifications
You must be signed in to change notification settings - Fork 0
/
authbot.conf
34 lines (24 loc) · 833 Bytes
/
authbot.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Discord Authorizer Bot Service
description "Discord Authorizer Bot"
author "Hornwitser"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on stopping network-services
respawn
env SOCKET=/var/run/authbot/socket
env USER=www-data
env GROUP=www-data
# For loading an apparmour profile, uncomment the next line
#apparmour load /etc/apparmor.d/<profile>
chdir "/opt/authbot"
pre-start script
# Set up socket directory if it doesn't exist
[ -d `dirname $SOCKET` ] || \
install -m 755 -o $USER -g $GROUP -d `dirname $SOCKET`
# Remove socket if it present
[ -f $SOCKET ] || rm -f $SOCKET
end script
exec sudo -u $USER -g $GROUP sh -c "umask 007 && exec python3 bot.py"
post-stop script
# Remove socket if it was left over by bot
[ -f $SOCKET ] || rm -f $SOCKET
end script