1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00

Make service starter accept bees options

The service starter wasn't able to pass options to the new getopt
parser. This commit fixes it.
This commit is contained in:
Kai Krakow 2017-10-28 00:14:36 +02:00
parent 629e33b4f3
commit 47805253e6

View File

@ -23,7 +23,23 @@ readonly CONFIG_DIR=@PREFIX@/etc/bees/
command -v @LIBEXEC_PREFIX@/bees &> /dev/null || ERRO "Missing 'bees' agent"
## Parse args
UUID="$1"
ARGUMENTS=()
while [ $# -gt 0 ]; do
case "$1" in
-*)
ARGUMENTS+=($1)
;;
*)
if [ -z "$UUID" ]; then
UUID="$1"
else
ERRO "Only one filesystem may be supplied"
fi
;;
esac
shift
done
case "$UUID" in
*-*-*-*-*)
FILE_CONFIG=""
@ -38,7 +54,7 @@ case "$UUID" in
source "$FILE_CONFIG"
;;
*)
echo "beesd <btrfs_uuid>"
echo "beesd [options] <btrfs_uuid>"
exit 1
;;
esac
@ -108,6 +124,6 @@ filter_path(){
fi
}
@LIBEXEC_PREFIX@/bees $OPTIONS "$MNT_DIR" 3>&1 2>&1 | filter_path
@LIBEXEC_PREFIX@/bees ${ARGUMENTS[@]} $OPTIONS "$MNT_DIR" 3>&1 2>&1 | filter_path
exit 0