This repository has been archived on 2024-05-11. You can view files and clone it, but cannot push or open issues or pull requests.
|
#!/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
|