12 lines
243 B
Bash
Executable file
12 lines
243 B
Bash
Executable file
#! /bin/bash
|
|
|
|
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
|
|
|
|
# set root password
|
|
if [ -n "$ROOTPW" ]; then
|
|
$ROOTCMD chpasswd --encrypted <<< "root:${ROOTPW}"
|
|
else
|
|
$ROOTCMD usermod -L root
|
|
fi
|
|
|
|
exit $error
|