You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
329 B
17 lines
329 B
3 years ago
|
#!/bin/sh
|
||
|
|
||
|
# explicitly requested empty root password
|
||
|
case "$GLOBAL_ROOTPW_EMPTY" in
|
||
|
1|y|Y|yes)
|
||
|
usermod -p "" root
|
||
|
exit 0
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
# set root password if any; no-op if it is empty
|
||
|
if [ -z "$GLOBAL_ROOTPW" ]; then
|
||
|
echo "** warning: no root password provided, skipping" >&2
|
||
|
else
|
||
|
echo "$GLOBAL_ROOTPW" | passwd --stdin root
|
||
|
fi
|