iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'upstream'
[automated-distro-installer]
/
fai
/
config
/
scripts
/
DEBIAN
/
10-rootpw
diff --git
a/fai/config/scripts/DEBIAN/10-rootpw
b/fai/config/scripts/DEBIAN/10-rootpw
index c1ee0b18f725043592835d9091eef6e53b60c7e5..bb77d1a30f5fe0eb2df8dc43d5abbfc8b80dcdb3 100755
(executable)
--- a/
fai/config/scripts/DEBIAN/10-rootpw
+++ b/
fai/config/scripts/DEBIAN/10-rootpw
@@
-3,6
+3,12
@@
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
# set root password
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
# set root password
-$ROOTCMD usermod -p "$ROOTPW" root
+if [ -n "$ROOTPW" ]; then
+ $ROOTCMD usermod -p "$ROOTPW" root
+else
+ $ROOTCMD usermod -L root
+ # enable sudo for user
+ ainsl /etc/sudoers "$username ALL = ALL"
+fi
exit $error
exit $error