summaryrefslogtreecommitdiff
path: root/scripts/install-system
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2008-10-29 16:46:58 -0700
committerBob Gilligan <gilligan@vyatta.com>2008-10-29 16:46:58 -0700
commit81bd193daacbf4b1f3ee74fe940151ac90174870 (patch)
treec01784e8b4ffde58803ed3cc7d0c9ab80876bd8e /scripts/install-system
parentfea9248fdbe724e7e44b65e298a3f3290ba1b767 (diff)
parent21b96894a7ad4e44838312668429cc5c670ee55b (diff)
downloadvyatta-cfg-quagga-81bd193daacbf4b1f3ee74fe940151ac90174870.tar.gz
vyatta-cfg-quagga-81bd193daacbf4b1f3ee74fe940151ac90174870.zip
Merge branch 'islavista' of http://git.vyatta.com/vyatta-cfg-system into islavista
Diffstat (limited to 'scripts/install-system')
-rwxr-xr-x[-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..e4464ede 100644..100755
--- 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_encrypted_password $user $epwd $rootfsdir$ofrconfdir/config.boot
}
system_setup () {