__user support for --create-home
This commit is contained in:
parent
459ea4cfd9
commit
60f85c5b85
2 changed files with 8 additions and 1 deletions
|
@ -39,6 +39,7 @@ shorten_property() {
|
||||||
password) ret="-p";;
|
password) ret="-p";;
|
||||||
shell) ret="-s";;
|
shell) ret="-s";;
|
||||||
uid) ret="-u";;
|
uid) ret="-u";;
|
||||||
|
create-home) ret="-m";;
|
||||||
esac
|
esac
|
||||||
echo "$ret"
|
echo "$ret"
|
||||||
}
|
}
|
||||||
|
@ -76,6 +77,7 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then
|
||||||
home) field=6 ;;
|
home) field=6 ;;
|
||||||
shell) field=7 ;;
|
shell) field=7 ;;
|
||||||
uid) field=3 ;;
|
uid) field=3 ;;
|
||||||
|
create-home) continue;; # Does not apply to user modification
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# If we haven't already set $current_value above, pull it from the
|
# If we haven't already set $current_value above, pull it from the
|
||||||
|
@ -102,7 +104,11 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then
|
||||||
else
|
else
|
||||||
for property in $(ls .); do
|
for property in $(ls .); do
|
||||||
new_value="$(cat "$property")"
|
new_value="$(cat "$property")"
|
||||||
|
if [ -z $new_value ];then # Boolean values have no value
|
||||||
|
set -- "$@" "$(shorten_property $property)"
|
||||||
|
else
|
||||||
set -- "$@" "$(shorten_property $property)" \'$new_value\'
|
set -- "$@" "$(shorten_property $property)" \'$new_value\'
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$os" = "freebsd" ]; then
|
if [ "$os" = "freebsd" ]; then
|
||||||
|
|
1
cdist/conf/type/__user/parameter/boolean
Normal file
1
cdist/conf/type/__user/parameter/boolean
Normal file
|
@ -0,0 +1 @@
|
||||||
|
create-home
|
Loading…
Reference in a new issue