Update finish.sh

This commit is contained in:
FusionPBX 2023-05-10 18:47:31 -06:00 committed by GitHub
parent 8a99470e0c
commit 6d9bdb58af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -38,8 +38,10 @@ sed -i /etc/fusionpbx/config.conf -e s:"{database_name}:$database_name:"
sed -i /etc/fusionpbx/config.conf -e s:"{database_username}:$database_username:" sed -i /etc/fusionpbx/config.conf -e s:"{database_username}:$database_username:"
sed -i /etc/fusionpbx/config.conf -e s:"{database_password}:$database_password:" sed -i /etc/fusionpbx/config.conf -e s:"{database_password}:$database_password:"
sleep 1
#add the database schema #add the database schema
cd /var/www/fusionpbx && php /var/www/fusionpbx/core/upgrade/upgrade_schema.php > /dev/null 2>&1 cd /var/www/fusionpbx && php /var/www/fusionpbx/core/upgrade/upgrade_schema.php
#get the server hostname #get the server hostname
if [ .$domain_name = .'hostname' ]; then if [ .$domain_name = .'hostname' ]; then
@ -58,7 +60,7 @@ domain_uuid=$(/usr/bin/php /var/www/fusionpbx/resources/uuid.php);
psql --host=$database_host --port=$database_port --username=$database_username -c "insert into v_domains (domain_uuid, domain_name, domain_enabled) values('$domain_uuid', '$domain_name', 'true');" psql --host=$database_host --port=$database_port --username=$database_username -c "insert into v_domains (domain_uuid, domain_name, domain_enabled) values('$domain_uuid', '$domain_name', 'true');"
#app defaults #app defaults
cd /var/www/fusionpbx && php /var/www/fusionpbx/core/upgrade/upgrade_domains.php cd /var/www/fusionpbx && /usr/bin/php /var/www/fusionpbx/core/upgrade/upgrade_domains.php
#add the user #add the user
user_uuid=$(/usr/bin/php /var/www/fusionpbx/resources/uuid.php); user_uuid=$(/usr/bin/php /var/www/fusionpbx/resources/uuid.php);
@ -69,7 +71,7 @@ if [ .$system_password = .'random' ]; then
else else
user_password=$system_password user_password=$system_password
fi fi
password_hash=$(php -r "echo md5('$user_salt$user_password');"); password_hash=$(/usr/bin/php -r "echo md5('$user_salt$user_password');");
psql --host=$database_host --port=$database_port --username=$database_username -t -c "insert into v_users (user_uuid, domain_uuid, username, password, salt, user_enabled) values('$user_uuid', '$domain_uuid', '$user_name', '$password_hash', '$user_salt', 'true');" psql --host=$database_host --port=$database_port --username=$database_username -t -c "insert into v_users (user_uuid, domain_uuid, username, password, salt, user_enabled) values('$user_uuid', '$domain_uuid', '$user_name', '$password_hash', '$user_salt', 'true');"
#get the superadmin group_uuid #get the superadmin group_uuid
@ -92,7 +94,7 @@ sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"{v_user}:$xml_cdr
sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"{v_pass}:$xml_cdr_password:" sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"{v_pass}:$xml_cdr_password:"
#app defaults #app defaults
cd /var/www/fusionpbx && php /var/www/fusionpbx/core/upgrade/upgrade.php cd /var/www/fusionpbx && /usr/bin/php /var/www/fusionpbx/core/upgrade/upgrade.php
#restart freeswitch #restart freeswitch
/bin/systemctl daemon-reload /bin/systemctl daemon-reload