Fix __group type failing with --gid

The command `echo -- -g` prints `-- -g` so the generated `groupadd` command
was syntactically incorrect and failing. Solution was to remove `--` since
echo command does not understand it, and add instead an extra space before
`-g` to avoid echo interpreting it as a flag.
This commit is contained in:
Dimitrios Apostolou 2018-11-18 01:30:40 +01:00
parent f8fbcdf2a7
commit 2cae33f6d6

View file

@ -30,9 +30,9 @@ state="$(cat "$__object/parameter/state")"
# Use short option names for portability
shorten_property() {
case "$1" in
gid) echo -- "-g";;
password) echo -- "-p";;
system) echo -- "-r";;
gid) echo " -g";;
password) echo " -p";;
system) echo " -r";;
esac
}