Migrate from useradd/usermod to pw
useradd/usermod don't exist in freebsd.
This commit is contained in:
parent
2be4b36da0
commit
1116bcc504
1 changed files with 12 additions and 2 deletions
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
name="$__object_id"
|
name="$__object_id"
|
||||||
|
|
||||||
|
os="$(cat "$__global/explorer/os")"
|
||||||
|
|
||||||
# We need to shorten options for both usermod and useradd since on some
|
# We need to shorten options for both usermod and useradd since on some
|
||||||
# systems (such as *BSD, Darwin) those commands do not handle GNU style long
|
# systems (such as *BSD, Darwin) those commands do not handle GNU style long
|
||||||
# options.
|
# options.
|
||||||
|
@ -89,7 +91,11 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
|
if [ "$os" = "freebsd" ]; then
|
||||||
|
echo pw usermod "$@" "$name"
|
||||||
|
else
|
||||||
echo usermod "$@" "$name"
|
echo usermod "$@" "$name"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
true
|
true
|
||||||
fi
|
fi
|
||||||
|
@ -99,5 +105,9 @@ else
|
||||||
set -- "$@" "$(shorten_property $property)" \'$new_value\'
|
set -- "$@" "$(shorten_property $property)" \'$new_value\'
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$os" = "freebsd" ]; then
|
||||||
|
echo pw useradd "$@" "$name"
|
||||||
|
else
|
||||||
echo useradd "$@" "$name"
|
echo useradd "$@" "$name"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue