use same logic in tz as km

This commit is contained in:
Tobias Powalowski 2023-03-07 17:29:18 +01:00
parent 7698603004
commit ebe7d8d9ac

View file

@ -147,15 +147,21 @@ _mainmenu() {
_abort ;;
esac
}
: >/tmp/.tz
if [[ -e /tmp/.tz-running ]]; then
echo "tz already runs on a different console!"
echo "Please remove /tmp/.tz-running first to launch tz!"
exit 1
fi
: >/tmp/.tz-running
if [[ "${1}" = "--setup" ]]; then
if ! _dotimezone; then
[[ -e /tmp/.km-running ]] && rm /tmp/.km-running
[[ -e /tmp/.tz-running ]] && rm /tmp/.tz-running
clear
exit 1
fi
if ! _dotimeset; then
[[ -e /tmp/.km-running ]] && rm /tmp/.km-running
[[ -e /tmp/.tz-running ]] && rm /tmp/.tz-running
clear
exit 1
fi
@ -163,17 +169,9 @@ if [[ "${1}" = "--setup" ]]; then
else
_EXIT="Exit"
fi
if [[ -e /tmp/.tz-running ]]; then
echo "tz already runs on a different console!"
echo "Please remove /tmp/.tz-running first to launch tz!"
exit 1
fi
: >/tmp/.tz-running
while true; do
_mainmenu
done
clear
exit 0
# vim: set ts=4 sw=4 et: