summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRick Balocca <rbalocca@vyatta.com>2008-10-28 11:48:24 -0700
committerRick Balocca <rbalocca@vyatta.com>2008-10-28 11:48:24 -0700
commit841e41f385ca960fb703ff612b014d7e57560b3e (patch)
tree1c85e6040bbce551469aaa5461bcc2c58ba32da6 /scripts
parent056c3079a791a246907a442e35063f42af5b3a99 (diff)
parent3537c028bc63e18568e70dfd3c1634d857918bc2 (diff)
downloadvyatta-cfg-system-841e41f385ca960fb703ff612b014d7e57560b3e.tar.gz
vyatta-cfg-system-841e41f385ca960fb703ff612b014d7e57560b3e.zip
Merge branch 'islavista' into jenner
Conflicts: scripts/install-system scripts/standalone_root_pw_reset
Diffstat (limited to 'scripts')
-rwxr-xr-x[-rw-r--r--]scripts/install-system2
-rw-r--r--scripts/snmp/vyatta-snmp.pl2
-rwxr-xr-xscripts/standalone_root_pw_reset15
3 files changed, 10 insertions, 9 deletions
diff --git a/scripts/install-system b/scripts/install-system
index 15977259..23109bea 100644..100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -861,7 +861,7 @@ change_password() {
# escape any slashes in resulting password
local epwd=$(mkpasswd -H md5 "$pwd1" | sed 's:/:\\/:g')
- set_encypted_password $user $epwd $rootfsdir$ofrconfdir/config.boot
+ set_encrypted_password $user $epwd $rootfsdir$ofrconfdir/config.boot
}
# setup grub on the boot sector of a user queried drive
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl
index 6de63fb0..58dc374f 100644
--- a/scripts/snmp/vyatta-snmp.pl
+++ b/scripts/snmp/vyatta-snmp.pl
@@ -163,7 +163,7 @@ sub snmp_write_snmpv3_user {
my $vyatta_user = shift;
my $user = "rouser $vyatta_user\n";
- system ("sed -i '/user[[:space:]]*vyatta[[:alnum:]]*/d' $snmp_snmpv3_user_conf;");
+ system ("sed -i '/user[[:space:]]*vyatta[[:alnum:]]*/d' $snmp_snmpv3_user_conf 2>/dev/null;");
open(my $fh, '>>', $snmp_snmpv3_user_conf) || die "Couldn't open $snmp_snmpv3_user_conf - $!";
print $fh $user;
close $fh;
diff --git a/scripts/standalone_root_pw_reset b/scripts/standalone_root_pw_reset
index d7507d3b..8322f9d0 100755
--- a/scripts/standalone_root_pw_reset
+++ b/scripts/standalone_root_pw_reset
@@ -25,6 +25,10 @@ CF=/opt/vyatta/etc/config/config.boot
# Admin user name
ADMIN=vyatta
+set_encrypted_password() {
+ sed -i \
+ -e "/ user $1 {/,/}/s/encrypted-password .*\$/encrypted-password: \"$2\"/" $3
+}
change_password() {
local user=$1
@@ -33,9 +37,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" ]
@@ -45,10 +49,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\"/" \
- $CF
+ set_encrypted_password $user $epwd $CF
}
echo "Standalone root password recovery tool."
@@ -103,7 +104,7 @@ change_password $ADMIN
echo $(date "+%b%e %T") $(hostname) "Admin password changed" \
| tee -a /var/log/auth.log >>/var/log/messages
-
+
sync
echo "System will reboot in 10 seconds..."