mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-27 00:38:27 +00:00
Merge remote-tracking branch 'origin/dev#1.1' into dev#1.1
This commit is contained in:
commit
c45757c6e0
@ -72,13 +72,6 @@ Get the status of the server. Show if the process is running, if the server is u
|
|||||||
#### arkmanager checkupdate
|
#### arkmanager checkupdate
|
||||||
Check if a new version of the server is available but not apply it
|
Check if a new version of the server is available but not apply it
|
||||||
|
|
||||||
#### arkmanager broadcast [message]
|
|
||||||
broadcast a message to ARK server chat
|
|
||||||
|
|
||||||
```sh
|
|
||||||
arkmanager broadcast "your message here"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
Original author of arkmanager: LeXaT
|
Original author of arkmanager: LeXaT
|
||||||
|
|||||||
@ -12,24 +12,25 @@ tar -zxvf master.tar.gz
|
|||||||
# Install ARK Server Tools
|
# Install ARK Server Tools
|
||||||
cd ark-server-tools-master/tools
|
cd ark-server-tools-master/tools
|
||||||
chmod +x install.sh
|
chmod +x install.sh
|
||||||
sh install.sh $1
|
sh install.sh $1 > /dev/null
|
||||||
|
|
||||||
status = $?
|
status=$?
|
||||||
|
|
||||||
# Remove the installation files
|
# Remove the installation files
|
||||||
rm -f master.tar.gz
|
rm -f master.tar.gz
|
||||||
rm -rf /tmp/ark-server-tools-master
|
rm -rf /tmp/ark-server-tools-master
|
||||||
|
|
||||||
|
# Print messages
|
||||||
|
case "$status" in
|
||||||
|
"0")
|
||||||
|
echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!"
|
||||||
|
;;
|
||||||
|
|
||||||
if [ $status == 0 ]; then
|
"1")
|
||||||
echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!"
|
echo "Something where wrong :("
|
||||||
fi
|
;;
|
||||||
|
"2")
|
||||||
if [ $status == 1 ]; then
|
echo "WARNING: A previous version of ARK Server Tools was detected in your system, your old configuration was not overwritten. You may need to manually update it."
|
||||||
echo "Something where wrong :("
|
echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!"
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
if [ $status == 2 ]; then
|
|
||||||
echo "WARNING: A previous version of ARK Server Tools was detected in your system, your old configuration was not overwritten. You may need to manually update it."
|
|
||||||
echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!"
|
|
||||||
fi
|
|
||||||
|
|||||||
@ -168,7 +168,7 @@ doStop() {
|
|||||||
# kill the server with the PID
|
# kill the server with the PID
|
||||||
PID=`ps -ef | grep "$arkserverroot/$arkserverexec" | grep -v grep | awk '{print $2}'`
|
PID=`ps -ef | grep "$arkserverroot/$arkserverexec" | grep -v grep | awk '{print $2}'`
|
||||||
kill -9 $PID
|
kill -9 $PID
|
||||||
echo "$timestamp: stop" >> "$logdir/arkserver.log"
|
echo "$timestamp: stop" >> "$logdir/arkserver.log"
|
||||||
else
|
else
|
||||||
echo "The server is already stopped"
|
echo "The server is already stopped"
|
||||||
fi
|
fi
|
||||||
@ -216,16 +216,11 @@ doUpdate() {
|
|||||||
./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid +quit
|
./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid +quit
|
||||||
echo "$bnumber" > "$arkserverroot/arkversion"
|
echo "$bnumber" > "$arkserverroot/arkversion"
|
||||||
echo "$timestamp: update to $bnumber complete" >> "$logdir/update.log"
|
echo "$timestamp: update to $bnumber complete" >> "$logdir/update.log"
|
||||||
tail -n 1 "$logdir/arkserver.log"
|
|
||||||
|
|
||||||
# we restart the server only if it was started before the update
|
# we restart the server only if it was started before the update
|
||||||
if [ $serverWasAlive -eq 1 ]; then
|
if [ $serverWasAlive -eq 1 ]; then
|
||||||
doStart
|
doStart
|
||||||
fi
|
fi
|
||||||
# send mail to admin
|
|
||||||
#if [ -z $servermail ]; then
|
|
||||||
# mail -a $logdir/update.log -s "Update-Log" $servermail < /dev/null
|
|
||||||
#fi
|
|
||||||
else
|
else
|
||||||
echo "No update available"
|
echo "No update available"
|
||||||
echo "$timestamp: No update needed." >> "$logdir/update.log"
|
echo "$timestamp: No update needed." >> "$logdir/update.log"
|
||||||
@ -233,16 +228,6 @@ doUpdate() {
|
|||||||
fi;
|
fi;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Broadcast message to server
|
|
||||||
#
|
|
||||||
doInfo() {
|
|
||||||
if [ ! -z $1 ]; then
|
|
||||||
info=$1
|
|
||||||
fi
|
|
||||||
screen -S "$servicename" -p 0 -X stuff "broadcast $info $(printf \\r)"
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Print the status of the server (running? online? version?)
|
# Print the status of the server (running? online? version?)
|
||||||
#
|
#
|
||||||
@ -277,13 +262,10 @@ case "$1" in
|
|||||||
restart)
|
restart)
|
||||||
doStop
|
doStop
|
||||||
echo "$timestamp: stop" >> "$logdir/arkserver.log"
|
echo "$timestamp: stop" >> "$logdir/arkserver.log"
|
||||||
tail -n 1 "$logdir/arkserver.log"
|
|
||||||
sleep 10
|
sleep 10
|
||||||
doStart
|
doStart
|
||||||
echo "$timestamp: start" >> "$logdir/arkserver.log"
|
echo "$timestamp: start" >> "$logdir/arkserver.log"
|
||||||
tail -n 1 "$logdir/arkserver.log"
|
|
||||||
echo "$timestamp: restart" >> "$logdir/arkserver.log"
|
echo "$timestamp: restart" >> "$logdir/arkserver.log"
|
||||||
tail -n 1 "$logdir/arkserver.log"
|
|
||||||
;;
|
;;
|
||||||
install)
|
install)
|
||||||
doInstall
|
doInstall
|
||||||
|
|||||||
@ -24,7 +24,7 @@ if [ ! -z "$1" ]; then
|
|||||||
# Copy arkmanager.cfg inside linux configuation folder if it doesn't already exists
|
# Copy arkmanager.cfg inside linux configuation folder if it doesn't already exists
|
||||||
mkdir -p "${INSTALL_ROOT}/etc/arkmanager"
|
mkdir -p "${INSTALL_ROOT}/etc/arkmanager"
|
||||||
if [ -f "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg" ]; then
|
if [ -f "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg" ]; then
|
||||||
echo "A previous version of ARK Server Tools was detected in your system, your old configuration was not overwritten. You may need to manually update it.";
|
echo "A previous version of ARK Server Tools was detected in your system, your old configuration was not overwritten. You may need to manually update it."
|
||||||
exit 2
|
exit 2
|
||||||
else
|
else
|
||||||
cp -n arkmanager.cfg "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg"
|
cp -n arkmanager.cfg "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user