initial commit

This commit is contained in:
Jordan Evans 2015-06-15 10:17:20 -07:00
commit 08d9495a72
47 changed files with 6983 additions and 0 deletions

View file

@ -0,0 +1,59 @@
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: bwbar
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: generates text and graphical readout of current bandwidth use
# Description: This program will output a PNG and a text file that can be
# used in scripts or be included in web pages to show current
# bandwidth usage.
### END INIT INFO
if [ -r /etc/default/bwbar ]; then
. /etc/default/bwbar
fi
# default settings are suggestions, they may or may not fit your situation
RUNME=/usr/sbin/bwbar
case "$1" in
start)
if [ -z "$DIR" -a -z "$RUNAS" -a -z "$OPTIONS" ]
then
echo "not starting bwbar, please edit /etc/default/bwbar"
exit 0
fi
echo -n "Starting bwbar: "
start-stop-daemon --start -b -c $RUNAS --exec $RUNME -- --directory=$DIR $OPTIONS
echo "done."
;;
stop)
if [ -z "$DIR" -a -z "$RUNAS" -a -z "$OPTIONS" ]
then
exit 0
fi
echo -n "Stopping bwbar: "
start-stop-daemon --stop -u $RUNAS --exec $RUNME
echo "done."
;;
restart|force-reload)
if [ -z "$DIR" -a -z "$RUNAS" -a -z "$OPTIONS" ]
then
echo "not starting bwbar, please edit /etc/default/bwbar"
exit 0
fi
echo -n "Restarting bwbar: "
start-stop-daemon --stop -u $RUNAS --exec $RUNME
sleep 1
start-stop-daemon --start -b -c $RUNAS --exec $RUNME -- --directory=$DIR $OPTIONS
echo "done."
;;
*)
echo "Usage: /etc/init.d/bwbar {start|stop|restart}"
exit 1
esac
exit 0

View file

@ -0,0 +1,6 @@
# Directory to put files into
#DIR=/var/www
# Who to run as
#RUNAS=www-data
# What are the options (eth0, scale of 1.5mbps)
#OPTIONS="eth0 1.5"

View file

@ -0,0 +1,5 @@
#!/bin/sh
cp bwbar debian/bwbar/usr/sbin/
cp debian/otherfiles/bwbar debian/bwbar/etc/init.d/
cp debian/otherfiles/bwbar-default debian/bwbar/etc/default/bwbar
chmod 755 debian/bwbar/etc/init.d/bwbar