Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
fix replace shell replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
timche committed Jun 23, 2020
1 parent 1369790 commit c36791b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
6 changes: 3 additions & 3 deletions pug-practice/server_pug_practice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ set_damageprint_cvars() {
fi
}

if [ ! -z $1 ]; then
if [ ! -z $1 ]; then
$1
else
$server install_or_update
Expand All @@ -76,5 +76,5 @@ else
set_cvars
set_damageprint_cvars
$server sync_custom_files
$server start
fi
exec $server start
fi
26 changes: 12 additions & 14 deletions sourcemod/server_sourcemod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,7 +38,7 @@ install_or_update_mod() {

wget -qO- $2 | tar zxf -

echo $2 > $1
echo $2 >$1

echo '> Done'
fi
Expand All @@ -54,15 +54,15 @@ 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]} ..."

wget -q -O plugin.zip ${args[2]}
unzip -qo plugin.zip
rm plugin.zip

echo ${args[2]} > ${args[1]}
echo ${args[2]} >${args[1]}

echo '> Done'
fi
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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" ..
Expand All @@ -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
Expand All @@ -146,5 +144,5 @@ else
$server should_add_server_configs
$server should_disable_bots
$server sync_custom_files
$server start
fi
exec $server start
fi

0 comments on commit c36791b

Please sign in to comment.