Skip to content
Snippets Groups Projects
Commit 7940bad4 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-lock-password: convert to invariant script and remove legacy script

parent 6f112794
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
passwd -l root
#!/bin/sh
has_root_pwd() {
local pwd=$([ -f "$1" ] && cat "$1")
local pwd
pwd=$([ -f "$1" ] && cat "$1")
pwd="${pwd#*root:}"
pwd="${pwd%%:*}"
test -n "${pwd#[\!x]}"
test -n "${pwd}"
}
has_root_pwd /etc/passwd || has_root_pwd /etc/shadow || passwd -l root
has_root_pwd /etc/shadow || passwd -l root
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment