diff --git a/scripts/core/sxmo_common.sh b/scripts/core/sxmo_common.sh index e0e600f..485742f 100644 --- a/scripts/core/sxmo_common.sh +++ b/scripts/core/sxmo_common.sh @@ -9,6 +9,16 @@ # we disable shellcheck SC2034 (variable not used) # for all the variables we define here +# Determine current operating system +if [ -f /etc/os-release ]; then + # freedesktop.org and systemd + # shellcheck disable=SC2034 + . /etc/os-release + export OS="$NAME" +else + export OS="Unknown" +fi + # shellcheck disable=SC2034 export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-$HOME/.local/run}" # shellcheck disable=SC2034 diff --git a/scripts/modem/sxmo_modemmonitortoggle.sh b/scripts/modem/sxmo_modemmonitortoggle.sh index 0cf1824..f37aa35 100755 --- a/scripts/modem/sxmo_modemmonitortoggle.sh +++ b/scripts/modem/sxmo_modemmonitortoggle.sh @@ -10,14 +10,6 @@ # shellcheck source=scripts/core/sxmo_common.sh . "$(dirname "$0")/sxmo_common.sh" -if [ -f /etc/os-release ]; then - # freedesktop.org and systemd - . /etc/os-release - OS=$NAME -else - OS="Unknown" -fi - daemon_start() { case "$OS" in "Alpine Linux"|postmarketOS)