14 lines
176 B
Plaintext
14 lines
176 B
Plaintext
|
#!/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
|