From c818a2adff28dc9f576ad71f298b6e0e3e573074 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 23 Nov 2014 22:53:42 +0000 Subject: [PATCH] migrated fn_loginstall migrated fn_loginstall. Fixed issue with symbolic link for server logs being created even if it does not exit for that server. --- Arma3/arma3server | 24 +++++++----------------- BladeSymphony/bsserver | 20 +++++--------------- CounterStrike/csserver | 22 ++++++---------------- CounterStrikeConditionZero/csczserver | 22 ++++++---------------- CounterStrikeGlobalOffensive/csgoserver | 22 ++++++---------------- CounterStrikeSource/cssserver | 22 ++++++---------------- DayOfDefeat/dodserver | 22 ++++++---------------- DayOfDefeatSource/dodsserver | 22 ++++++---------------- FistfulOfFrags/fofserver | 22 ++++++---------------- GarrysMod/gmodserver | 22 ++++++---------------- HalfLife2Deathmatch/hl2dmserver | 22 ++++++---------------- HalfLifeDeathmatchClassic/hldmcserver | 22 ++++++---------------- Insurgency/insserver | 22 ++++++---------------- JustCause2/jc2server | 24 +++++++----------------- KillingFloor/kfserver | 22 ++++++---------------- Left4Dead/l4dserver | 22 ++++++---------------- Left4Dead2/l4d2server | 22 ++++++---------------- NaturalSelection2/ns2server | 22 ++++++---------------- NoMoreRoomInHell/nmrihserver | 22 ++++++---------------- RedOrchestra/roserver | 22 ++++++---------------- TeamFortress2/tf2server | 22 ++++++---------------- TeamFortressClassic/tfcserver | 22 ++++++---------------- UnrealTournament2004/ut2k4server | 21 +++++++-------------- UnrealTournament99/ut99server | 19 +++++++------------ functions/fn_loginstall | 25 +++++++++++++++++++++++++ 25 files changed, 172 insertions(+), 379 deletions(-) create mode 100644 functions/fn_loginstall diff --git a/Arma3/arma3server b/Arma3/arma3server index 82b60b3dc..25509b8c0 100644 --- a/Arma3/arma3server +++ b/Arma3/arma3server @@ -4,7 +4,7 @@ # Author: Daniel Gibbs # Contributor: Scarsz # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -55,7 +55,7 @@ masterport=$(sed -n -e '12 p' ${servercfgfullpath} 2>/dev/null| sed 's/[\/\; ]// # Logging logdays="7" -gamelogdir="${systemdir}/logs" +#gamelogdir="" # No server logs available scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" @@ -714,21 +714,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index e6f15dbe6..d636001d0 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -704,21 +704,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_steamfix ]; then + functionfile="fn_steamfix" + fn_fninstall +fi +source ${rootdir}/functions/fn_steamfix } fn_getquery(){ diff --git a/CounterStrike/csserver b/CounterStrike/csserver index 94a01810a..ed73e2b58 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -695,21 +695,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index 7e155e355..ff6905b21 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -695,21 +695,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index 5fec75317..cdb708516 100644 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -781,21 +781,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index 540ec4952..9a003e50c 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -696,21 +696,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index 27839eca2..75e49bdbf 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 061014 +# Version: 231114 #### Variables #### @@ -695,21 +695,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index 29d877389..aa1efbcc6 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -704,21 +704,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver index fa2d3093b..ad7da8386 100644 --- a/FistfulOfFrags/fofserver +++ b/FistfulOfFrags/fofserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -704,21 +704,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver index 7ee9db922..50c41d1af 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -709,21 +709,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index 3c16c80b6..9d62fb272 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -696,21 +696,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/HalfLifeDeathmatchClassic/hldmcserver b/HalfLifeDeathmatchClassic/hldmcserver index aaa710509..b384b726b 100644 --- a/HalfLifeDeathmatchClassic/hldmcserver +++ b/HalfLifeDeathmatchClassic/hldmcserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -695,21 +695,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/Insurgency/insserver b/Insurgency/insserver index 6e9431d1e..75ebb79f7 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -704,21 +704,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/JustCause2/jc2server b/JustCause2/jc2server index d5251503c..27d255861 100644 --- a/JustCause2/jc2server +++ b/JustCause2/jc2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 221114 +# Version: 231114 #### Variables #### @@ -53,7 +53,7 @@ servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's # Logging logdays="7" -gamelogdir="${systemdir}/logs" +#gamelogdir="" # No server logs available scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" @@ -690,21 +690,11 @@ echo "" } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_jc2config(){ diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index 3168108f7..055590d49 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -720,21 +720,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver index 6caba7766..a7af2f2ea 100644 --- a/Left4Dead/l4dserver +++ b/Left4Dead/l4dserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -706,21 +706,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index ebb2ee629..c88bb8fc2 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -695,21 +695,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index a43047000..7547d9e65 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -703,21 +703,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index c1e8bb4d1..6b4f81343 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -704,21 +704,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver index 756b7306c..f3b38d24f 100644 --- a/RedOrchestra/roserver +++ b/RedOrchestra/roserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -716,21 +716,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server index 369fa3a6f..65bf6ea10 100644 --- a/TeamFortress2/tf2server +++ b/TeamFortress2/tf2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -696,21 +696,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index 6eb0092ae..6fc428510 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -695,21 +695,11 @@ source ${rootdir}/functions/fn_steamfix } fn_loginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -if [ ! -h ${rootdir}/log/server ]; then - ln -sv "${gamelogdir}" "${rootdir}/log/server" -else - echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" -fi -sleep 1 -echo "" +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server index fa8d22565..9a0a9a136 100644 --- a/UnrealTournament2004/ut2k4server +++ b/UnrealTournament2004/ut2k4server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -736,19 +736,12 @@ done echo "" } -fn_utloginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -mkdir -pv "${gamelogdir}" -touch "${gamelog}" -sleep 1 -echo "" +fn_loginstall(){ +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server index 130b0b058..45b1ff588 100644 --- a/UnrealTournament99/ut99server +++ b/UnrealTournament99/ut99server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 121114 +# Version: 231114 #### Variables #### @@ -715,17 +715,12 @@ done echo "" } -fn_utloginstall(){ -echo "Creating log directorys" -echo "=================================" -sleep 1 -mkdir -pv "${rootdir}/log" -mkdir -pv "${scriptlogdir}" -touch "${scriptlog}" -mkdir -pv "${consolelogdir}" -touch "${consolelog}" -sleep 1 -echo "" +fn_loginstall(){ +if [ ! -f ${rootdir}/functions/fn_loginstall ]; then + functionfile="fn_loginstall" + fn_fninstall +fi +source ${rootdir}/functions/fn_loginstall } fn_getquery(){ diff --git a/functions/fn_loginstall b/functions/fn_loginstall new file mode 100644 index 000000000..45ddd2718 --- /dev/null +++ b/functions/fn_loginstall @@ -0,0 +1,25 @@ +#!/bin/bash +# LGSM fn_loginstall function +# Author: Daniel Gibbs +# Website: http://danielgibbs.co.uk +# Version: 231114 + +echo "Creating log directorys" +echo "=================================" +sleep 1 +# Create dir's for the script and console logs +mkdir -pv "${rootdir}/log" +mkdir -pv "${scriptlogdir}" +touch "${scriptlog}" +mkdir -pv "${consolelogdir}" +touch "${consolelog}" +# if a server is source or goldsource create a symbolic link to the game server logs +if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then + if [ ! -h ${rootdir}/log/server ]; then + ln -sv "${gamelogdir}" "${rootdir}/log/server" + else + echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" + fi +fi +sleep 1 +echo "" \ No newline at end of file