This repository has been archived on 2024-05-18. You can view files and clone it, but cannot push or open issues or pull requests.
soifai/config/scripts/DEBIAN/10-rootpw

13 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