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 ;; _abort ;;
esac 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 [[ "${1}" = "--setup" ]]; then
if ! _dotimezone; then if ! _dotimezone; then
[[ -e /tmp/.km-running ]] && rm /tmp/.km-running [[ -e /tmp/.tz-running ]] && rm /tmp/.tz-running
clear clear
exit 1 exit 1
fi fi
if ! _dotimeset; then if ! _dotimeset; then
[[ -e /tmp/.km-running ]] && rm /tmp/.km-running [[ -e /tmp/.tz-running ]] && rm /tmp/.tz-running
clear clear
exit 1 exit 1
fi fi
@ -163,17 +169,9 @@ if [[ "${1}" = "--setup" ]]; then
else else
_EXIT="Exit" _EXIT="Exit"
fi 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 while true; do
_mainmenu _mainmenu
done done
clear clear
exit 0 exit 0
# vim: set ts=4 sw=4 et: # vim: set ts=4 sw=4 et: