mirror of https://github.com/dirtbags/moth.git
Commit mothd and its systemd service
This commit is contained in:
parent
6436d97316
commit
631d1d800c
2
bin/once
2
bin/once
|
@ -7,7 +7,7 @@ else
|
|||
fi
|
||||
basedir=$(pwd)
|
||||
|
||||
printf "Updating moth instance in %s\n" $(pwd)
|
||||
[ -n "$DEBUG" ] && printf "Updating moth instance in %s\n" $(pwd)
|
||||
|
||||
# Do nothing if `disabled` is present
|
||||
if [ -f disabled ]; then
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#! /bin/sh
|
||||
|
||||
cd ${1:-$(dirname $0)}
|
||||
KOTH_BASE=$(pwd)
|
||||
|
||||
echo "Running koth instances in $KOTH_BASE"
|
||||
|
||||
while true; do
|
||||
for i in $KOTH_BASE/*/assigned.txt; do
|
||||
dir=${i%/*}
|
||||
$dir/bin/once
|
||||
done
|
||||
sleep 5
|
||||
done
|
|
@ -0,0 +1,18 @@
|
|||
# To install:
|
||||
# sudo cp mothd.service /etc/systemd/system/moth.service
|
||||
# sudo systemctl enable mothd
|
||||
# sudo systemctl start mothd
|
||||
|
||||
[Unit]
|
||||
Description=Monarch Of The Hill server
|
||||
After=network.target auditd.service
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/srv/moth
|
||||
User=www-data
|
||||
ExecStart=/srv/moth/mothd
|
||||
KillMode=process
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue