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
update to 72d79e141d3aaf430bb44f6036a2980f3f5865bd
[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 bb77d1a30f5fe0eb2df8dc43d5abbfc8b80dcdb3..329e2f6220caa87a16eaf66a13f4937e60d43e5e 100755
(executable)
--- a/
fai/config/scripts/DEBIAN/10-rootpw
+++ b/
fai/config/scripts/DEBIAN/10-rootpw
@@
-4,11
+4,14
@@
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
# set root password
if [ -n "$ROOTPW" ]; then
# set root password
if [ -n "$ROOTPW" ]; then
- $ROOTCMD
usermod -p "$ROOTPW" root
-el
se
+ $ROOTCMD
chpasswd --encrypted <<< "root:${ROOTPW}"
+el
if [ -n "$username" ]; then
$ROOTCMD usermod -L root
# enable sudo for user
ainsl /etc/sudoers "$username ALL = ALL"
$ROOTCMD usermod -L root
# enable sudo for user
ainsl /etc/sudoers "$username ALL = ALL"
+ if [ ! -f $target/usr/bin/sudo ]; then
+ echo "WARNING. Package sudo is not installed"
+ fi
fi
exit $error
fi
exit $error