16 lines
302 B
Bash
Executable File
16 lines
302 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 usermod -p "$ROOTPW" root
|
|
else
|
|
$ROOTCMD usermod -L root
|
|
# enable sudo for user
|
|
ainsl /etc/sudoers "$username ALL = ALL"
|
|
fi
|
|
|
|
exit $error
|
|
|