Update local and remote versions at the same time

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2022-10-06 12:36:17 +02:00
parent 56527e5dd9
commit 18d28533eb
No known key found for this signature in database
5 changed files with 60 additions and 66 deletions

View file

@ -42,11 +42,6 @@ warning1() {
esac
}
updateCheckFunc() {
/opt/pihole/updatecheck.sh
/opt/pihole/updatecheck.sh x remote
}
checkout() {
local corebranches
local webbranches
@ -169,8 +164,8 @@ checkout() {
exit 1
fi
checkout_pull_branch "${webInterfaceDir}" "${2}"
# Force an update of the updatechecker
updateCheckFunc
# Update local and remote versions via updatechecker
/opt/pihole/updatecheck.sh
elif [[ "${1}" == "ftl" ]] ; then
local path
local oldbranch
@ -185,8 +180,8 @@ checkout() {
FTLinstall "${binary}"
restart_service pihole-FTL
enable_service pihole-FTL
# Force an update of the updatechecker
updateCheckFunc
# Update local and remote versions via updatechecker
/opt/pihole/updatecheck.sh
else
echo " ${CROSS} Requested branch \"${2}\" is not available"
ftlbranches=( $(git ls-remote https://github.com/pi-hole/ftl | grep 'heads' | sed 's/refs\/heads\///;s/ //g' | awk '{print $2}') )