#!/bin/bash $key="asdf" sed -i "s/\(^AMPDBPASS=*\)\(.*\)/\1$key/" /etc/amportal.conf echo "SET PASSWORD FOR 'asteriskuser'@'localhost' = PASSWORD('$key');" | mysql -u root sed -i "s/\(^secret = *\)\(.*\)/\1$key/" /etc/asterisk/manager.conf sed -i "s/\(^AMPMGRPASS=*\)\(.*\)/\1$key/" /etc/amportal.conf echo "mysql password changed and manager password changed\n"