diff options
author | James <> | 2013-03-17 12:16:37 +0000 |
---|---|---|
committer | James <> | 2013-03-17 12:16:37 +0000 |
commit | 27b76ab0671089c47506615a796a261e993896a7 (patch) | |
tree | 61213d67e7fa87b20356b23798558e2c4212c42f /package/base-files/files/etc/uci-defaults/.svn/text-base/10_migrate-shadow.svn-base | |
download | trunk-36060-master.tar.gz trunk-36060-master.tar.bz2 trunk-36060-master.zip |
Diffstat (limited to 'package/base-files/files/etc/uci-defaults/.svn/text-base/10_migrate-shadow.svn-base')
-rw-r--r-- | package/base-files/files/etc/uci-defaults/.svn/text-base/10_migrate-shadow.svn-base | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/package/base-files/files/etc/uci-defaults/.svn/text-base/10_migrate-shadow.svn-base b/package/base-files/files/etc/uci-defaults/.svn/text-base/10_migrate-shadow.svn-base new file mode 100644 index 0000000..b7ea571 --- /dev/null +++ b/package/base-files/files/etc/uci-defaults/.svn/text-base/10_migrate-shadow.svn-base @@ -0,0 +1,12 @@ +#!/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 |