UbuntuPIAF/avantfax-pw-change

17 lines
747 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
clear
echo "This script changes your AvantFAX admin password"
echo " "
echo -n "Enter new admin password (MAKE IT SECURE!!): "
read adminpw
echo " "
echo "admin password will be changed to: $adminpw"
read -p "Press ENTER key to continue or Ctrl-C to abort..."
mysql -u root -ppassw0rd -e "update avantfax.UserAccount set password = '`echo -n "$adminpw" | md5sum | awk '{ print $1 }'`' where username = 'admin' limit 1;"
mysql -u root -ppassw0rd -e "insert into avantfax.UserPasswords set uid = 1, pwdhash = '`echo -n "$adminpw" | md5sum | awk '{ print $1 }'`';"
echo " "
echo "Done. Use browser to access AvantFAX via link in FreePBX at http://`ifconfig | awk -F "[: ]+" '/inet addr:/ { if ($4 != "127.0.0.1") print $4 }'`"
echo " "