[package] libpcap: explicitely disable libnl support to prevent different build resul...
[openwrt.git] / package / base-files / files / etc / uci-defaults / migrate-shadow
1 #!/bin/sh
2
3 local ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)"
4 local spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)"
5
6 if [ -n "${ppwd#[\!x]}" ] && [ -z "${spwd#[\!x]}" ]; then
7 logger -t migrate-shadow "Moving root password hash into shadow database"
8 sed -i -e "s:^root\:[^\:]*\::root\:x\::" /etc/passwd
9 sed -i -e "s:^root\:[^\:]*\::root\:$ppwd\::" /etc/shadow
10 fi
11
12 exit 0
This page took 0.051046 seconds and 5 git commands to generate.