summaryrefslogtreecommitdiff
path: root/scripts/install-system
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-27 15:48:23 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-27 15:48:23 -0700
commit563fe9fa4b52db0ce46907abc28cb7995528aa45 (patch)
tree7b6d32c95c12fb87d7e696734f2b947c2040d880 /scripts/install-system
parent48bec978b2e2be9327163b8342a253cf69b61c6c (diff)
downloadvyatta-cfg-quagga-563fe9fa4b52db0ce46907abc28cb7995528aa45.tar.gz
vyatta-cfg-quagga-563fe9fa4b52db0ce46907abc28cb7995528aa45.zip
Fix password changer to deal with update config format
Colons are no longer used in config file format, so the sed command to change password was having no effect. Bugfix 3665
Diffstat (limited to 'scripts/install-system')
-rw-r--r--scripts/install-system14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/install-system b/scripts/install-system
index ff7a5d41..ea580179 100644
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -854,6 +854,11 @@ copy_config () {
fi
}
+set_encrypted_password() {
+ sed -i \
+ -e "/ user $1 {/,/}/s/encrypted-password .*\$/encrypted-password: \"$2\"/" $3
+}
+
change_password() {
local user=$1
local pwd1="1"
@@ -861,9 +866,9 @@ change_password() {
until [ "$pwd1" == "$pwd2" ]
do
- read -p "Enter $user password:" -r -s pwd1 <>/dev/tty 1>&0
+ read -p "Enter $user password:" -r -s pwd1 <>/dev/tty 2>&0
echo
- read -p "Retype $user password:" -r -s pwd2 <>/dev/tty 1>&0
+ read -p "Retype $user password:" -r -s pwd2 <>/dev/tty 2>&0
echo
if [ "$pwd1" != "$pwd2" ]
@@ -873,10 +878,7 @@ change_password() {
# escape any slashes in resulting password
local epwd=$(mkpasswd -H md5 "$pwd1" | sed 's:/:\\/:g')
-
- sed -i \
- -e "/ user $user {/,/}/s/encrypted-password:.*\$/encrypted-password: \"$epwd\"/" \
- $rootfsdir$ofrconfdir/config.boot
+ set_encypted_password $user $epwd $rootfsdir$ofrconfdir/config.boot
}
system_setup () {