root@a2estest2:~# su - postgres
postgres@a2estest2:~$ psql fusionpbx
psql (11.9 (Debian 11.9-0+deb10u1))
Type "help" for help.
fusionpbx=# select * from v_sip_profiles;
fusionpbx=# \q
postgres@a2estest2:~$ exit
logout
root@a2estest2:~#
#!/bin/bash
#settings
export PGPASSWORD="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
db_host=127.0.0.1
db_port=5432
if [ "$#" -lt 1 ]; then
echo "You must supply the name of a file containing SQL name as a command line argument."
exit 1
fi
if [ ! -f "$1" ]
then
echo "The SQL file does not exist."
exit 1
fi
echo ""
#show message to the console
psql --host=$db_host --port=$db_port --username=fusionpbx < $1
echo " "
echo "SQL Completed."
root@a2estest2:~# fs_cli -x "reloadxml"
+OK [Success]
root@a2estest2:~# fs_cli -x "xml_flush_cache"
+OK cleared 0 entries
root@a2estest2:~# fs_cli -x "sofia profile internal rescan"
Reload XML [Success]
+OK scan complete
root@a2estest2:~# fs_cli -x "sofia profile internal restart"
Reload XML [Success]
restarting: internal