This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
2018-08-24 03:57:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
NAME="Mystic BBS"
|
|
|
|
INIT=mis
|
|
|
|
|
|
|
|
function stop {
|
|
|
|
echo "Stopping ${NAME}"
|
|
|
|
kill $(ps -Af|grep ${INIT} |grep -v grep|awk '{ print $2}')
|
|
|
|
}
|
|
|
|
|
|
|
|
trap 'stop' SIGTERM
|
|
|
|
export PATH=$PATH:/mystic
|
|
|
|
|
|
|
|
if [ "$1" == "start" ]; then
|
|
|
|
# First time install - expand out our data directory
|
2018-09-13 13:35:11 +00:00
|
|
|
[ $(find data|wc -l) -le 1 ] && tar xzf data.tar.gz && echo "* Installing Mystic data files into /mystic/data"
|
2018-08-24 03:57:25 +00:00
|
|
|
|
|
|
|
# OK, start
|
|
|
|
exec ${INIT} server
|
|
|
|
|
|
|
|
else
|
|
|
|
exec $@
|
|
|
|
fi
|