Sfoglia il codice sorgente

Add extra branch check

When update hestia via v-update-sys-hestia-git jaapmarcus random-branch  
When after that calling v-update-sys-hestia-git 
system will check "hestiacp" "random-branch" that might not exists
Jaap Marcus 4 anni fa
parent
commit
6e8dd89f4e
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      bin/v-update-sys-hestia-git

+ 5 - 0
bin/v-update-sys-hestia-git

@@ -133,6 +133,11 @@ if [ ! -z "$2" ]; then
 else
 else
     source /usr/local/hestia/conf/hestia.conf
     source /usr/local/hestia/conf/hestia.conf
     branch=$RELEASE_BRANCH
     branch=$RELEASE_BRANCH
+    branch_check=$(curl -s --head -w %{http_code} https://raw.githubusercontent.com/$fork/hestiacp/$branch/src/deb/hestia/control -o /dev/null)
+    if [ $branch_check -ne "200" ]; then
+        echo "ERROR: invalid branch name specified."
+        exit 1
+    fi
 fi
 fi
 
 
 if [ -z "$branch" ]; then
 if [ -z "$branch" ]; then