Skip to content

Commit

Permalink
fix: Removed -beta from branch, it isn't requiered also removed dupli…
Browse files Browse the repository at this point in the history
…cated code. (#247)

Thanks to @karcsesz
  • Loading branch information
vinanrra authored Jun 24, 2024
1 parent 615d2a4 commit 317509b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 37 deletions.
20 changes: 1 addition & 19 deletions scripts/first_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,7 @@ then
fi

# Check version

if [ "${VERSION,,}" == 'stable' ] || [ "${VERSION,,}" == 'public' ]
then
if grep -R "branch" "$LSGMSDTDSERVERCFG"
then
sed -i "s/branch=.*/branch=\"\"/" $LSGMSDTDSERVERCFG
echo "[INFO] Version changed to ${VERSION,,}"
else
echo "[INFO] Selecting 7 days to die ${VERSION,,} version"
fi
else
if grep -R "branch" "$LSGMSDTDSERVERCFG"
then
sed -i "s/branch=".*"/branch=\"-beta ${VERSION,,}"\"/ $LSGMSDTDSERVERCFG
else
echo branch=\"-beta "${VERSION}"\" >> $LSGMSDTDSERVERCFG
echo "[INFO] Selecting 7 days to die ${VERSION,,} version"
fi
fi
source $scriptsDir/utils/set_version.sh

echo "[INFO] Installing 7 days to die ${VERSION,,} version"

Expand Down
19 changes: 1 addition & 18 deletions scripts/server_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,7 @@
BASEPATH=/home/sdtdserver
LSGMSDTDSERVERCFG=${BASEPATH}/lgsm/config-lgsm/sdtdserver/sdtdserver.cfg

if [ "${VERSION,,}" == 'stable' ] || [ "${VERSION,,}" == 'public' ]
then
if grep -R "branch" "$LSGMSDTDSERVERCFG"
then
sed -i "s/branch=.*/branch=\"\"/" $LSGMSDTDSERVERCFG
echo "[INFO] Version changed to ${VERSION,,}"
else
echo "[INFO] Selecting 7 days to die ${VERSION,,} version"
fi
else
if grep -R "branch" "$LSGMSDTDSERVERCFG"
then
sed -i "s/branch=".*"/branch=\"-beta ${VERSION,,}"\"/ $LSGMSDTDSERVERCFG
else
echo branch=\"-beta "${VERSION}"\" >> $LSGMSDTDSERVERCFG
echo "[INFO] Selecting 7 days to die ${VERSION,,} version"
fi
fi
source $scriptsDir/utils/set_version.sh

./sdtdserver update

Expand Down
18 changes: 18 additions & 0 deletions scripts/utils/set_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
if [ "${VERSION,,}" == 'stable' ] || [ "${VERSION,,}" == 'public' ]
then
if grep -R "branch" "$LSGMSDTDSERVERCFG"
then
sed -i "s/branch=.*/branch=\"\"/" $LSGMSDTDSERVERCFG
echo "[INFO] Version changed to ${VERSION,,}"
else
echo "[INFO] Selecting 7 days to die ${VERSION,,} version"
fi
else
if grep -R "branch" "$LSGMSDTDSERVERCFG"
then
sed -i "s/branch=".*"/branch=\"${VERSION,,}"\"/ $LSGMSDTDSERVERCFG
else
echo branch=\""${VERSION}"\" >> $LSGMSDTDSERVERCFG
echo "[INFO] Selecting 7 days to die ${VERSION,,} version"
fi
fi

0 comments on commit 317509b

Please sign in to comment.