Index: bluetooth-config =================================================================== --- bluetooth-config +++ bluetooth-config @@ -17,7 +17,7 @@ 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,11 @@ ?) 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