Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Removed -beta from branch, it isn't requiered also removed duplicated code. #247

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading