upstream 00f2ea2b8 as of 2018-09-02
[automated-distro-installer] / fai / config / scripts / DEBIAN / 10-rootpw
index c1ee0b18f725043592835d9091eef6e53b60c7e5..7a7f6177a30e398311f8b1659f61114487947767 100755 (executable)
@@ -3,6 +3,10 @@
 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
+fi
 
 exit $error