kernel: update linux 3.2 to 3.2.12
[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.053841 seconds and 5 git commands to generate.