#!/bin/sh
#
# SySBK 1.0 [sysbk@r-fx.net]
#
##############################################################################
#
# You may edit anything below this point at your own risk, do not request
# support for modified versions of this software. This is free software
# and free for redistribution in accordance with the GNU GPL.
#
##############################################################################

INSPATH="/usr/local/sysbk"
CNF="$INSPATH/conf.sysbk"
VER="1.0"

head() {
	echo "SysBK $VER [sysbk@r-fx.net]"
}

val() {
VAL="$1"
if [ -f "$VAL" ]; then
	. $VAL
else
	head
	echo "$VAL not found, aborting..."
	exit 1
fi
}

val $CNF
val $CNF_INT
val $INT_FILE

inter_exit() {
	postbk
	exit 1
}

trap inter_exit 2

go_bk() {
# Run our functions
 prebk
 check_load
 check_diskfree
 mod_init
 if [ "$USE_RTRANS" = "1" ]; then
        rtrans
 fi
 postbk
}

case "$1" in
-s)
	go_bk
	;;
-q)
	$0 -s >> /dev/null 2>&1
	;;
*)
	head
	echo "usage $0 [-s] [-q]"
esac
exit 0
