Merge branch 'user_create_home' of https://github.com/arkaitzj/cdist

This commit is contained in:
Nico Schottelius 2013-04-02 09:19:58 +02:00
commit dd566527a9
2 changed files with 8 additions and 1 deletions

View file

@ -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

View file

@ -0,0 +1 @@
create-home