UbuntuPIAF/avantfax-pw-change
Josh North 354e0908c6 Create avantfax-pw-change
Create password change script for avantfax
2014-08-25 10:55:01 -04:00

17 lines
747 B
Bash

#!/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 " "