#!/bin/sh export TEXTDOMAIN="zero-infinoted" MSG_STOP_INFINOTED="$(gettext "Do you want to stop infinoted?")" MSG_START_INFINOTED="$(gettext "Do you want to start infinoted?")" test_zinf(){ LANG=C status zero-infinoted |grep -q "start/running" || return 1 return 0 } ask_dialog(){ rc=0; zenity --question --text="$1" || rc=1 return $rc # return 0 or 1, please } if test_zinf ; then if ask_dialog "$MSG_STOP_INFINOTED" ; then stop zero-infinoted || true fi else if ask_dialog "$MSG_START_INFINOTED" ; then start zero-infinoted || true fi fi exit 0