diff options
Diffstat (limited to 'network/vnstat/rc.vnstat')
-rw-r--r-- | network/vnstat/rc.vnstat | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/network/vnstat/rc.vnstat b/network/vnstat/rc.vnstat index bb9e948c02b7e..e17d7cdeebe7c 100644 --- a/network/vnstat/rc.vnstat +++ b/network/vnstat/rc.vnstat @@ -43,6 +43,15 @@ vnstat_stop() { fi } +vnstat_status() { + pid="$(pidof $1)" + if [ -n "$pid" ]; then + echo "vnstat daemon is running with pid $pid" + else + echo "vnstat daemon is not running." + fi +} + vnstat_restart() { echo "restarting the vnstart daemon..." vnstat_stop @@ -50,24 +59,21 @@ vnstat_restart() { vnstat_start } - case "$1" in - 'start') - vnstat_start - ;; - 'stop') - vnstat_stop - ;; - 'restart','reload') - vnstat_restart - ;; - 'status') - vnstat_status - ;; - *) - echo "Usage: $0 {start|stop|restart|reload|status}" - exit 1 - ;; + 'start') + vnstat_start + ;; + 'stop') + vnstat_stop + ;; + 'restart'|'reload') + vnstat_restart + ;; + 'status') + vnstat_status vnstatd + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|status}" + exit 1 + ;; esac - - |