From: Willem Jan Withagen Date: Sat, 4 Feb 2017 22:09:02 +0000 (+0100) Subject: tools/scripts:"FreeBSD getopt is not compatible, use the one from packages" X-Git-Tag: v12.0.1~378^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e62a1f86c838b6df23f24c815689a7908e196914;p=ceph.git tools/scripts:"FreeBSD getopt is not compatible, use the one from packages" - src/ceph-osd-prestart.sh - src/ceph-osd-prestart.sh Signed-off-by: Willem Jan Withagen --- diff --git a/src/ceph-osd-prestart.sh b/src/ceph-osd-prestart.sh index 2e45724299c0..f946bf43b305 100644 --- a/src/ceph-osd-prestart.sh +++ b/src/ceph-osd-prestart.sh @@ -1,6 +1,12 @@ #!/bin/sh -eval set -- "$(getopt -o i: --long id:,cluster: -- $@)" +if [ `uname` = FreeBSD ]; then + GETOPT=/usr/local/bin/getopt +else + GETOPT=getopt +fi + +eval set -- "$(${GETOPT} -o i: --long id:,cluster: -- $@)" while true ; do case "$1" in diff --git a/src/ceph-post-file.in b/src/ceph-post-file.in index 3c9884a14999..8a88a03bd4c8 100755 --- a/src/ceph-post-file.in +++ b/src/ceph-post-file.in @@ -53,7 +53,13 @@ description="" user="`whoami`@`hostname -f`" remote="postfile@drop.ceph.com" -ARGS=$(getopt -n "ceph-post-file" -o 'd:u:hk:i:r:' -l "description:,user:,help,known-hosts:,remote:" -- "$@") +if [ `uname` = FreeBSD ]; then + GETOPT=/usr/local/bin/getopt +else + GETOPT=getopt +fi + +ARGS=$(${GETOPT} -n "ceph-post-file" -o 'd:u:hk:i:r:' -l "description:,user:,help,known-hosts:,remote:" -- "$@") eval set -- $ARGS while true; do