| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #!/bin/bash
- # info: update web templates
- # options: [RESTART]
- #
- # The function for changing the release branch for the
- # Hestia Control Panel. This allows the user to switch between
- # stable and pre-release builds which will automaticlly update
- # based on the appropriate release schedule if auto-update is
- # turned on.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument definition
- branch=$1
- # Includes
- source $HESTIA/func/main.sh
- source $HESTIA/conf/hestia.conf
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- if [ -z "$branch" ]; then
- echo "Error: no release branch specified."
- echo "Usage: v-change-sys-release branchname"
- echo ""
- echo "Common release branches:"
- echo "(*) master: Stable releases only"
- echo "(*) develop: Daily development builds"
- echo ""
- echo "You can also specify another branch name from the"
- echo "GitHub repository to install the code from that branch."
- echo ""
- exit
- else
- # Check that requested branch exists
- echo "Checking for existence of $branch branch..."
- branch_check=$(curl -s --head -w %{http_code} https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/deb/hestia/control -o /dev/null)
- if [ $branch_check -ne "200" ]; then
- echo "Error: invalid branch name specified."
- exit 1
- fi
- # Remove old branch variable
- sed -i "/RELEASE_BRANCH/d" $HESTIA/conf/hestia.conf
-
- # Set new branch variable
- echo "RELEASE_BRANCH='$branch'" >> $HESTIA/conf/hestia.conf
- echo "Changed system release to update from Git branch: $branch"
- fi
- #----------------------------------------------------------#
- # Hestia #
- #----------------------------------------------------------#
- exit
|