|
|
@@ -3,7 +3,7 @@
|
|
|
# Server Management Script
|
|
|
# Author: Daniel Gibbs
|
|
|
# Website: http://danielgibbs.co.uk
|
|
|
-# Version: 050814
|
|
|
+# Version: 100914
|
|
|
|
|
|
#### Variables ####
|
|
|
|
|
|
@@ -38,7 +38,7 @@ servicename="cscz-server"
|
|
|
gamename="Counter Strike: Condition Zero"
|
|
|
engine="goldsource"
|
|
|
|
|
|
-# Directorys
|
|
|
+# Directories
|
|
|
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
selfname="$0"
|
|
|
lockselfname=$(echo ".${servicename}.lock")
|
|
|
@@ -191,18 +191,26 @@ fn_debugserver(){
|
|
|
fn_rootcheck
|
|
|
fn_syscheck
|
|
|
fn_autoip
|
|
|
+fn_distro
|
|
|
+fn_uptime
|
|
|
+fn_load
|
|
|
fn_parms
|
|
|
echo ""
|
|
|
echo "${gamename} Debug"
|
|
|
echo "============================"
|
|
|
echo ""
|
|
|
-echo -e "Use for identifying server issues only!"
|
|
|
-echo -e "Press CTRL+c to drop out of debug mode"
|
|
|
-echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
|
|
|
+echo -e "Distro: ${os}"
|
|
|
+echo -e "Arch: ${arch}"
|
|
|
+echo -e "Kernel: ${kernel}"
|
|
|
+echo -e "Hostname: $HOSTNAME"
|
|
|
echo ""
|
|
|
echo "Start parameters:"
|
|
|
echo ${parms}
|
|
|
echo ""
|
|
|
+echo -e "Use for identifying server issues only!"
|
|
|
+echo -e "Press CTRL+c to drop out of debug mode"
|
|
|
+echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
|
|
|
+echo ""
|
|
|
while true; do
|
|
|
read -p "Continue? [y/N]" yn
|
|
|
case $yn in
|
|
|
@@ -466,14 +474,15 @@ fn_monitorserver(){
|
|
|
fn_rootcheck
|
|
|
fn_syscheck
|
|
|
fn_autoip
|
|
|
+fn_printdots "Monitoring ${servicename}: ${servername}"
|
|
|
+sleep 1
|
|
|
if [ ! -f ${lockselfname} ]; then
|
|
|
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
|
|
|
sleep 1
|
|
|
echo -en "\n"
|
|
|
+ echo "To enable monitor run ${selfname} start"
|
|
|
exit
|
|
|
fi
|
|
|
-fn_printdots "Monitoring ${servicename}: ${servername}"
|
|
|
-sleep 1
|
|
|
fn_scriptlog "Monitoring ${servername}"
|
|
|
updatecheck=$(ps -ef|grep "${selfname} update"|grep -v grep|wc -l)
|
|
|
if [ "${updatecheck}" = "0" ]; then
|
|
|
@@ -649,33 +658,6 @@ echo ""
|
|
|
## Installer
|
|
|
#
|
|
|
|
|
|
-fn_csczappmanifest(){
|
|
|
-appdir="${filesdir}/1ea271ace3aa6eb2cbade5b6f37851d19ffb9e6f"
|
|
|
-if [ ${pass} == 1 ]; then
|
|
|
- echo "Creating appmanifest directory. (app 90 fix)"
|
|
|
- sleep 2
|
|
|
- mkdir -v "${filesdir}"
|
|
|
- mkdir -v "${appdir}"
|
|
|
- cd "${appdir}"
|
|
|
- echo "Removing any existing appmanifest files. (app 90 fix)"
|
|
|
- sleep 2
|
|
|
- rm -f appmanifest_10.acf appmanifest_70.acf appmanifest_90.acf
|
|
|
-elif [ ${pass} == 2 ]; then
|
|
|
- echo "Downloading HLDS appmanifest files. (app 90 fix)"
|
|
|
- sleep 2
|
|
|
- cd "${appdir}"
|
|
|
- wget https://raw.github.com/dgibbs64/linuxgameservers/master/appmanifest/appmanifest_10.acf
|
|
|
- wget https://raw.github.com/dgibbs64/linuxgameservers/master/appmanifest/appmanifest_70.acf
|
|
|
- wget https://raw.github.com/dgibbs64/linuxgameservers/master/appmanifest/appmanifest_90.acf
|
|
|
-elif [ ${pass} == 3 ]; then
|
|
|
- echo "Downloading ${gamename} appmanifest files. (app 90 fix)"
|
|
|
- sleep 2
|
|
|
- cd "${appdir}"
|
|
|
- rm -f appmanifest_90.acf
|
|
|
- wget https://raw.github.com/dgibbs64/linuxgameservers/master/appmanifest/czero/appmanifest_90.acf
|
|
|
-fi
|
|
|
-}
|
|
|
-
|
|
|
fn_header(){
|
|
|
clear
|
|
|
echo "================================="
|
|
|
@@ -709,13 +691,12 @@ echo ""
|
|
|
}
|
|
|
|
|
|
fn_steaminstall(){
|
|
|
+echo "Installing ${gamename} Server"
|
|
|
+echo "================================="
|
|
|
sleep 1
|
|
|
mkdir -pv "${filesdir}"
|
|
|
cd "${rootdir}/steamcmd"
|
|
|
STEAMEXE=steamcmd ./steamcmd.sh +login ${steamuser} ${steampass} +force_install_dir "${filesdir}" +app_update ${appid} validate +quit
|
|
|
-}
|
|
|
-
|
|
|
-fn_success(){
|
|
|
echo ""
|
|
|
echo "================================="
|
|
|
while true; do
|
|
|
@@ -762,7 +743,7 @@ fn_retryinstall(){
|
|
|
while true; do
|
|
|
read -p "Retry install? [y/N]" yn
|
|
|
case $yn in
|
|
|
- [Yy]* ) fn_install;;
|
|
|
+ [Yy]* ) fn_install; exit;;
|
|
|
[Nn]* ) echo Exiting; exit;;
|
|
|
* ) echo "Please answer yes or no.";;
|
|
|
esac
|
|
|
@@ -798,20 +779,7 @@ while true; do
|
|
|
done
|
|
|
fn_header
|
|
|
fn_steamdl
|
|
|
-echo "Installing ${gamename} Server"
|
|
|
-echo "================================="
|
|
|
-pass=1
|
|
|
-fn_csczappmanifest
|
|
|
-pass=2
|
|
|
-fn_csczappmanifest
|
|
|
-fn_steaminstall
|
|
|
-fn_steaminstall
|
|
|
-pass=3
|
|
|
-fn_csczappmanifest
|
|
|
-fn_steaminstall
|
|
|
-fn_steaminstall
|
|
|
fn_steaminstall
|
|
|
-fn_success
|
|
|
fn_steamfix
|
|
|
fn_loginstall
|
|
|
echo "Configuring ${gamename} Server"
|