gluon/package/gluon-lock-password/files/lib/gluon/upgrade/100-lock-password

14 lines
176 B
Plaintext
Raw Normal View History

#!/bin/sh
has_root_pwd() {
local pwd
pwd=$([ -f "$1" ] && cat "$1")
pwd="${pwd#*root:}"
pwd="${pwd%%:*}"
test -n "${pwd}"
}
has_root_pwd /etc/shadow || passwd -l root