Skip to content

Commit cb6d9f2

Browse files
Kristan Kenneyunknown
authored andcommitted
Update v-change-sys-release
Ensure that specified branch in upstream Git repository exists before saving.
1 parent ee1a0a5 commit cb6d9f2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bin/v-change-sys-release

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,16 @@ if [ -z "$branch" ]; then
3636
echo ""
3737
exit
3838
else
39+
# Check that requested branch exists
40+
branch_check=$(curl -s --head -w %{http_code} https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/deb/hestia/control -o /dev/null)
41+
if [ $branch_check -ne "200" ]; then
42+
echo "Error: invalid branch name specified."
43+
exit 1
44+
fi
45+
3946
# Remove old branch variable
4047
sed -i "/RELEASE_BRANCH/d" $HESTIA/conf/hestia.conf
48+
4149
# Set new branch variable
4250
echo "RELEASE_BRANCH='$branch'" >> $HESTIA/conf/hestia.conf
4351
echo "Changed system to follow release branch: $branch"

0 commit comments

Comments
 (0)