This repository has been archived on 2024-05-18. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
soifai/config/scripts/DEBIAN/10-rootpw
2022-07-15 11:59:26 +02:00

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