mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Switch detached head for daily updates (#8194)
If HEAD is detached, switch to master. (Detached head is ok for the release version)
This commit is contained in:
committed by
Neil Lathwood
parent
b834d2d4b4
commit
3ddeb1dbc5
6
daily.sh
6
daily.sh
@ -194,6 +194,12 @@ main () {
|
||||
update_res=0
|
||||
if [[ "$up" == "1" ]] || [[ "$php_ver_ret" == "1" ]]; then
|
||||
# Update current branch to latest
|
||||
local branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [[ "$branch" == "HEAD" ]]; then
|
||||
# if the branch is HEAD, then we are not on a branch, checkout master
|
||||
git checkout master
|
||||
fi
|
||||
|
||||
old_ver=$(git rev-parse --short HEAD)
|
||||
status_run 'Updating to latest codebase' 'git pull --quiet' 'update'
|
||||
update_res=$?
|
||||
|
Reference in New Issue
Block a user