From c36791b9f8a9a93bcbc37c418f481bb02ad06799 Mon Sep 17 00:00:00 2001 From: Tim Cheung Date: Tue, 23 Jun 2020 09:00:23 +0100 Subject: [PATCH] fix replace shell replacement --- pug-practice/server_pug_practice.sh | 6 +++--- sourcemod/server_sourcemod.sh | 26 ++++++++++++-------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pug-practice/server_pug_practice.sh b/pug-practice/server_pug_practice.sh index c29b419..2d8dbf1 100755 --- a/pug-practice/server_pug_practice.sh +++ b/pug-practice/server_pug_practice.sh @@ -63,7 +63,7 @@ set_damageprint_cvars() { fi } -if [ ! -z $1 ]; then +if [ ! -z $1 ]; then $1 else $server install_or_update @@ -76,5 +76,5 @@ else set_cvars set_damageprint_cvars $server sync_custom_files - $server start -fi \ No newline at end of file + exec $server start +fi diff --git a/sourcemod/server_sourcemod.sh b/sourcemod/server_sourcemod.sh index 617b599..0aa655a 100755 --- a/sourcemod/server_sourcemod.sh +++ b/sourcemod/server_sourcemod.sh @@ -23,13 +23,13 @@ install_or_update_mod() { if [ -f "$1" ]; then installed=$(<$1) - + if [ "${installed}" != "$2" ]; then echo "> Updating mod ${1} from ${2} ..." wget -qO- $2 | tar zxf - - echo $2 > $1 + echo $2 >$1 echo '> Done' fi @@ -38,7 +38,7 @@ install_or_update_mod() { wget -qO- $2 | tar zxf - - echo $2 > $1 + echo $2 >$1 echo '> Done' fi @@ -54,7 +54,7 @@ install_or_update_plugin() { if [ -f "${args[1]}" ]; then installed=$(<${args[1]}) - + if [ "${installed}" != "${args[2]}" ]; then echo "> Updating SourceMod plugin ${args[1]} from ${args[2]} ..." @@ -62,7 +62,7 @@ install_or_update_plugin() { unzip -qo plugin.zip rm plugin.zip - echo ${args[2]} > ${args[1]} + echo ${args[2]} >${args[1]} echo '> Done' fi @@ -73,7 +73,7 @@ install_or_update_plugin() { unzip -qn plugin.zip rm plugin.zip - echo ${args[2]} > ${args[1]} + echo ${args[2]} >${args[1]} echo '> Done' fi @@ -92,8 +92,7 @@ manage_plugins() { fi done elif [ -n "${SOURCEMOD_PLUGINS_DISABLED}" ]; then - for plugin in $(echo $SOURCEMOD_PLUGINS_DISABLED | sed "s/,/ /g") - do + for plugin in $(echo $SOURCEMOD_PLUGINS_DISABLED | sed "s/,/ /g"); do if [ -f "${plugin}.smx" ]; then echo "> Disabling ${plugin}.smx" mv "${plugin}.smx" disabled @@ -111,8 +110,7 @@ manage_plugins() { fi done elif [ -n "${SOURCEMOD_PLUGINS_ENABLED}" ]; then - for plugin in $(echo $SOURCEMOD_PLUGINS_ENABLED | sed "s/,/ /g") - do + for plugin in $(echo $SOURCEMOD_PLUGINS_ENABLED | sed "s/,/ /g"); do if [ -f "${plugin}.smx" ]; then echo "> Enabling ${plugin}.smx" mv "${plugin}.smx" .. @@ -131,12 +129,12 @@ manage_admins() { touch $admins_simple for steamid in $(echo $SOURCEMOD_ADMINS | sed "s/,/ /g"); do - echo "\"$steamid\" \"z\"" >> $admins_simple + echo "\"$steamid\" \"z\"" >>$admins_simple done fi } -if [ ! -z $1 ]; then +if [ ! -z $1 ]; then $1 else $server install_or_update @@ -146,5 +144,5 @@ else $server should_add_server_configs $server should_disable_bots $server sync_custom_files - $server start -fi \ No newline at end of file + exec $server start +fi