3 error
=0; trap 'error=$(($?>$error?$?:$error))' ERR
# save maximum error code
6 if [ -n "$ROOTPW" ]; then
7 $ROOTCMD chpasswd
--encrypted <<< "root:${ROOTPW}"
8 elif [ -n "$username" ]; then
9 $ROOTCMD usermod
-L root
10 # enable sudo for user
11 ainsl
/etc
/sudoers
"$username ALL = ALL"
12 if [ ! -f $target/usr
/bin
/sudo
]; then
13 echo "WARNING. Package sudo is not installed"