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

This commit is contained in:
Matthias Schiffer 2015-01-23 05:51:13 +01:00
parent 8c4d363198
commit 2792d1fdd1
3 changed files with 13 additions and 16 deletions

View File

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

View File

@ -0,0 +1,13 @@
#!/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