Files
packages/utils/boxbackup/files/bbstoreaccounts
cshore 94b4825f79 [packages] utils/boxbackup: Added boxbackup. Currently only the server is fully integrated (init script and uci), but it compiles and the server works.
git-svn-id: svn://svn.openwrt.org/openwrt/packages@28023 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-08-16 22:10:23 +00:00

35 lines
763 B
Bash
Executable File

#!/bin/sh
. /etc/functions.sh
. /lib/functions/bbstored.sh
bxbk_config_file=
NORUN=
if [ "$1" = "-c" ]; then
shift
bxbk_config_file="$1"
shift
else
if [ -z "$1" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
/usr/lib/boxbackup/bbstoreaccounts -h
exit 1
fi
if [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ] || [ -z "$5" ]; then
/usr/lib/boxbackup/bbstoreaccounts -h
exit 1
fi
config_load bbstored
create_config
if [ "$EXTERNAL_CONFIG" = "1" ]; then
bxbk_config_file="$EXTERNAL_CONF_FILE"
else
bxbk_config_file="$BXBK_CONFIG_PATH/bbstored.conf"
fi
fi
[ "$NORUN" != "1" ] && [ -n "$bxbk_config_file" ] && /usr/lib/boxbackup/bbstoreaccounts -c "$bxbk_config_file" "$@" || {
echo "Error managing account using '$bxbk_config_file'"
exit 1
}