Update finish.sh
This commit is contained in:
parent
f234d1484b
commit
29f55141b6
|
|
@ -4,14 +4,18 @@
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
#includes
|
#includes
|
||||||
|
. ./config.sh
|
||||||
. ./colors.sh
|
. ./colors.sh
|
||||||
. ./arguments.sh
|
. ./arguments.sh
|
||||||
|
#. ./environment.sh
|
||||||
|
|
||||||
#database details
|
#database details
|
||||||
database_host=127.0.0.1
|
database_host=127.0.0.1
|
||||||
database_port=5432
|
database_port=5432
|
||||||
database_username=fusionpbx
|
database_username=fusionpbx
|
||||||
database_password=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64 | sed 's/[=\+//]//g')
|
if [ .$database_password = .'random' ]; then
|
||||||
|
database_password=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64 | sed 's/[=\+//]//g')
|
||||||
|
fi
|
||||||
|
|
||||||
#allow the script to use the new password
|
#allow the script to use the new password
|
||||||
export PGPASSWORD=$database_password
|
export PGPASSWORD=$database_password
|
||||||
|
|
@ -48,8 +52,12 @@ cd /var/www/fusionpbx && 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);
|
||||||
user_salt=$(/usr/bin/php /var/www/fusionpbx/resources/uuid.php);
|
user_salt=$(/usr/bin/php /var/www/fusionpbx/resources/uuid.php);
|
||||||
user_name=admin
|
user_name=$system_username
|
||||||
user_password=$(dd if=/dev/urandom bs=1 count=12 2>/dev/null | base64 | sed 's/[=\+//]//g')
|
if [ .$system_password = .'random' ]; then
|
||||||
|
user_password=$(dd if=/dev/urandom bs=1 count=12 2>/dev/null | base64 | sed 's/[=\+//]//g')
|
||||||
|
else
|
||||||
|
user_password=$system_password
|
||||||
|
fi
|
||||||
password_hash=$(php -r "echo md5('$user_salt$user_password');");
|
password_hash=$(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');"
|
||||||
|
|
||||||
|
|
@ -74,6 +82,7 @@ sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"{v_pass}:$xml_cdr
|
||||||
#app defaults
|
#app defaults
|
||||||
cd /var/www/fusionpbx && php /var/www/fusionpbx/core/upgrade/upgrade_domains.php
|
cd /var/www/fusionpbx && php /var/www/fusionpbx/core/upgrade/upgrade_domains.php
|
||||||
|
|
||||||
|
#restart services
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl mask wpa_supplicant.service
|
systemctl mask wpa_supplicant.service
|
||||||
systemctl stop wpa_supplicant.service
|
systemctl stop wpa_supplicant.service
|
||||||
|
|
@ -84,11 +93,21 @@ systemctl enable nginx
|
||||||
systemctl enable freeswitch
|
systemctl enable freeswitch
|
||||||
systemctl enable memcached
|
systemctl enable memcached
|
||||||
systemctl enable postgresql-9.4
|
systemctl enable postgresql-9.4
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart freeswitch
|
||||||
|
|
||||||
#welcome message
|
#welcome message
|
||||||
echo ""
|
echo ""
|
||||||
verbose "Installation has completed."
|
verbose "Installation has completed."
|
||||||
error "Please note details below and reboot your system"
|
echo ""
|
||||||
|
echo " Use a web browser to login."
|
||||||
|
echo " domain name: https://$domain_name"
|
||||||
|
echo " username: $user_name"
|
||||||
|
echo " password: $user_password"
|
||||||
|
echo ""
|
||||||
|
echo " The domain name in the browser is used by default as part of the authentication."
|
||||||
|
echo " If you need to login to a different domain then use username@domain."
|
||||||
|
echo " username: $user_name@$domain_name";
|
||||||
echo ""
|
echo ""
|
||||||
echo " Official FusionPBX Training"
|
echo " Official FusionPBX Training"
|
||||||
echo " Fastest way to learn FusionPBX. For more information https://www.fusionpbx.com."
|
echo " Fastest way to learn FusionPBX. For more information https://www.fusionpbx.com."
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue