]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/system/vnstat
vnstat 2.6: Fix for initscript - removed 'evaluate_retval'
[people/pmueller/ipfire-2.x.git] / src / initscripts / system / vnstat
1 #!/bin/sh
2 # Begin $rc_base/init.d/vnstat
3
4 . /etc/sysconfig/rc
5 . $rc_functions
6
7 eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
8
9 if [ "$VNSTATLOG" = '' ]; then
10 VNSTATLOG=/var/log/vnstat
11 fi
12
13 case "$1" in
14 start)
15 if use_ramdisk; then
16 boot_mesg "Mounting vnstat ramdisk..."
17 mount_ramdisk "${VNSTATLOG}"
18 evaluate_retval
19 fi
20
21 boot_mesg "Starting vnstatd..."
22 loadproc /usr/sbin/vnstatd -d --alwaysadd
23 ;;
24
25 stop)
26 boot_mesg "Stopping vnstatd..."
27 killproc /usr/sbin/vnstatd
28 evaluate_retval
29
30 umount_ramdisk "${VNSTATLOG}"
31 boot_mesg "Unmounting vnstat ramdisk..."
32 ;;
33
34 restart)
35 ${0} stop
36 sleep 1
37 ${0} start
38 ;;
39
40 status)
41 statusproc /usr/sbin/vnstatd
42 ;;
43
44 backup)
45 # Backup all data if ramdisk is used
46 if mountpoint "${RRDLOG}" &>/dev/null; then
47 ${0} restart
48 fi
49 ;;
50
51 *)
52 echo "Usage: $0 {start|stop|restart|status|backup}"
53 exit 1
54 ;;
55 esac
56
57 # End $rc_base/init.d/vnstat