aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh')
-rwxr-xr-xusr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh b/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh
index 48a399a82fc7..148325fcecbc 100755
--- a/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh
+++ b/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh
@@ -17,7 +17,7 @@ main() {
unset node device started bdaddresses retry
# Only one command at the moment is scan (+ add)
-[ "$#" -eq 1 -a "$1" = "scan" ] || print_syntax
+[ "$1" = "scan" ] || print_syntax
shift
# Get command line options
@@ -28,6 +28,12 @@ while getopts :d:n: arg; do
?) print_syntax;;
esac
done
+shift "$((OPTIND-1))"
+
+# If there's leftover parameters, print usage
+[ "$#" -eq 0 ] || print_syntax
+shift
+
# No use running without super user rights
if [ $( id -u ) -ne 0 ]; then