Commit c94639f6 authored by PhiBo's avatar PhiBo 🚀

task - New task to set root password

parent 17e5b8d3
#!/bin/sh
. $LIB_DIR/core.sh
ROOT_PASSWORD=root
# Check if foce flag is available
PASSWD_FORCE=$(passwd --help | grep '\-f' > /dev/null && echo "-f")
# Check if stdin flag is available
PASSWD_STDIN=$(passwd --help | grep '\-\-stdin' > /dev/null && echo "--stdin")
if [ "$PASSWD_STDIN" = "" ]; then
echo "$ROOT_PASSWORD\n$ROOT_PASSWORD" | passwd $PASSWD_FORCE root
else
echo "$ROOT_PASSWORD" | passwd $PASSWD_FORCE $PASSWD_STDIN root
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment