]> git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/system/vnstat
unbound: Drop certificates for local control connection
[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 stop)
22 umount_ramdisk "${VNSTATLOG}"
23 ;;
24
25 backup)
26 # Backup all data if ramdisk is used
27 if mountpoint "${RRDLOG}" &>/dev/null; then
28 ${0} restart
29 fi
30 ;;
31
32 *)
33 echo "Usage: $0 {start|stop|backup}"
34 exit 1
35 ;;
36 esac
37
38 # End $rc_base/init.d/vnstat