Fix: rc.flashbackup needs to check both signed in and connected (#882)

because /var/local/emhttp/myservers.cfg does not clear the connected status when the user signs out
This commit is contained in:
ljm42
2024-05-10 10:44:21 -07:00
committed by GitHub
parent 8d1e0f67d1
commit c995a4c5c8

View File

@@ -160,7 +160,14 @@ _connected() {
CFG=/var/local/emhttp/myservers.cfg
[[ ! -f "${CFG}" ]] && return 1
# shellcheck disable=SC1090
source <(sed -nr '/\[remote\]/,/\[/{/username/p}' "${CFG}" 2>/dev/null)
# ensure signed in
if [ -z "${username}" ]; then
return 1
fi
# shellcheck disable=SC1090
source <(sed -nr '/\[connectionStatus\]/,/\[/{/minigraph/p}' "${CFG}" 2>/dev/null)
# ensure connected
if [[ -z "${minigraph}" || "${minigraph}" != "CONNECTED" ]]; then
return 1
fi