mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-21 22:38:26 +00:00
Add OpenRC init script
This commit is contained in:
parent
d44b9e9f67
commit
a891e71e75
@ -27,6 +27,15 @@ if [ ! -z "$1" ]; then
|
|||||||
echo "Ark server will now start on boot, if you want to remove this feature run the following line"
|
echo "Ark server will now start on boot, if you want to remove this feature run the following line"
|
||||||
echo "chkconfig arkmanager off"
|
echo "chkconfig arkmanager off"
|
||||||
fi
|
fi
|
||||||
|
elif [ -f /sbin/runscript ]; then
|
||||||
|
cp openrc/arkdaemon "${INSTALL_ROOT}/etc/init.d/arkmanager"
|
||||||
|
chmod +x "${INSTALL_ROOT}/etc/init.d/arkmanager"
|
||||||
|
sed -i "s@^DAEMON=\"/usr/bin@DAEMON=\"${EXECPREFIX}@" "${INSTALL_ROOT}/etc/init.d/arkmanager"
|
||||||
|
if [ -x /sbin/rc-update -a -z "${INSTALL_ROOT}" ]; then
|
||||||
|
rc-update add arkmanager default
|
||||||
|
echo "Ark server will now start on boot, if you want to remove this feature run the following line"
|
||||||
|
echo "rc-update del arkmanager default"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create a folder in /var/log to let Ark tools write its own log files
|
# Create a folder in /var/log to let Ark tools write its own log files
|
||||||
|
|||||||
38
tools/openrc/arkdaemon
Normal file
38
tools/openrc/arkdaemon
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/sbin/runscript
|
||||||
|
# Short-Description: ARK manager deamon
|
||||||
|
# Description: ARK manager daemon used to start the server and keep it updated
|
||||||
|
|
||||||
|
source /etc/arkmanager/arkmanager.cfg
|
||||||
|
|
||||||
|
NAME="ShooterGameServer"
|
||||||
|
LOGFILE="${logdir}/${NAME}.log"
|
||||||
|
DAEMON="/usr/bin/arkmanager"
|
||||||
|
|
||||||
|
depend(){
|
||||||
|
require net
|
||||||
|
}
|
||||||
|
|
||||||
|
start(){
|
||||||
|
ebegin "Starting ARK manager daemon"
|
||||||
|
su -s /bin/sh -c "$DAEMON start" $steamcmd_user
|
||||||
|
sleep 5
|
||||||
|
PID=`ps -ef | grep $NAME | grep -v grep | awk '{print $2}'`
|
||||||
|
if [ -n "$PID" ]; then
|
||||||
|
eend 0
|
||||||
|
else
|
||||||
|
eend 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stop(){
|
||||||
|
ebegin "Stopping ARK manager daemon"
|
||||||
|
su -s /bin/sh -c "$DAEMON start" $steamcmd_user
|
||||||
|
sleep 5
|
||||||
|
PID=`ps -ef | grep $NAME | grep -v grep | awk '{print $2}'`
|
||||||
|
if [ -n "$PID" ]; then
|
||||||
|
eend 0
|
||||||
|
else
|
||||||
|
eend 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user