mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-03 04:09:41 +02:00
13 lines
418 B
Plaintext
13 lines
418 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
local ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)"
|
||
|
local spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)"
|
||
|
|
||
|
if [ -n "${ppwd#[\!x]}" ] && [ -z "${spwd#[\!x]}" ]; then
|
||
|
logger -t migrate-shadow "Moving root password hash into shadow database"
|
||
|
sed -i -e "s:^root\:[^\:]*\::root\:x\::" /etc/passwd
|
||
|
sed -i -e "s:^root\:[^\:]*\::root\:$ppwd\::" /etc/shadow
|
||
|
fi
|
||
|
|
||
|
exit 0
|