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:
parent
629e33b4f3
commit
47805253e6
@ -23,7 +23,23 @@ readonly CONFIG_DIR=@PREFIX@/etc/bees/
|
|||||||
command -v @LIBEXEC_PREFIX@/bees &> /dev/null || ERRO "Missing 'bees' agent"
|
command -v @LIBEXEC_PREFIX@/bees &> /dev/null || ERRO "Missing 'bees' agent"
|
||||||
|
|
||||||
## Parse args
|
## 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
|
case "$UUID" in
|
||||||
*-*-*-*-*)
|
*-*-*-*-*)
|
||||||
FILE_CONFIG=""
|
FILE_CONFIG=""
|
||||||
@ -38,7 +54,7 @@ case "$UUID" in
|
|||||||
source "$FILE_CONFIG"
|
source "$FILE_CONFIG"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "beesd <btrfs_uuid>"
|
echo "beesd [options] <btrfs_uuid>"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -108,6 +124,6 @@ filter_path(){
|
|||||||
fi
|
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
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user