Fix the fusionpbx git pull
This commit is contained in:
parent
3d9287de66
commit
c83134b436
|
|
@ -13,7 +13,7 @@ database_host=127.0.0.1
|
|||
database_port=5432
|
||||
database_username=fusionpbx
|
||||
if [ .$database_password = .'random' ]; then
|
||||
database_password=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64 | sed 's/[=\+//]//g')
|
||||
database_password=$(cat /dev/random | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 20)
|
||||
fi
|
||||
|
||||
#allow the script to use the new password
|
||||
|
|
@ -53,7 +53,7 @@ user_uuid=$(/usr/bin/php /var/www/fusionpbx/resources/uuid.php);
|
|||
user_salt=$(/usr/bin/php /var/www/fusionpbx/resources/uuid.php);
|
||||
user_name=$system_username
|
||||
if [ .$system_password = .'random' ]; then
|
||||
user_password=$(dd if=/dev/urandom bs=1 count=12 2>/dev/null | base64 | sed 's/[=\+//]//g')
|
||||
user_password=$(cat /dev/random | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 20)
|
||||
else
|
||||
user_password=$system_password
|
||||
fi
|
||||
|
|
@ -82,8 +82,7 @@ sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"{v_pass}:$xml_cdr
|
|||
cd /var/www/fusionpbx && php /var/www/fusionpbx/core/upgrade/upgrade_domains.php
|
||||
|
||||
#restart freeswitch
|
||||
/bin/systemctl daemon-reload
|
||||
/bin/systemctl restart freeswitch
|
||||
service freeswitch restart
|
||||
|
||||
#welcome message
|
||||
echo ""
|
||||
|
|
|
|||
|
|
@ -5,27 +5,23 @@ cd "$(dirname "$0")"
|
|||
|
||||
. ./config.sh
|
||||
. ./colors.sh
|
||||
. ./environment.sh
|
||||
|
||||
#send a message
|
||||
verbose "Installing FusionPBX"
|
||||
|
||||
#install dependencies
|
||||
apt-get install -y --force-yes vim git dbus haveged ssl-cert
|
||||
apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools
|
||||
pkg install --yes git ghostscript9-base tiff
|
||||
|
||||
if [ .$system_branch = "master" ]; then
|
||||
verbose "Using master"
|
||||
branch=""
|
||||
else
|
||||
system_major=$(git ls-remote --heads https://github.com/fusionpbx/fusionpbx.git | cut -d/ -f 3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f1)
|
||||
system_minor=$(git ls-remote --tags https://github.com/fusionpbx/fusionpbx.git $system_major.* | cut -d/ -f3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f2)
|
||||
system_version=$system_major.$system_minor
|
||||
system_version=4.2
|
||||
verbose "Using version $system_version"
|
||||
branch="-b $system_version"
|
||||
fi
|
||||
|
||||
#get the source code
|
||||
git clone $branch https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx
|
||||
chown -R www-data:www-data /var/www/fusionpbx
|
||||
chown -R www:www /var/www/fusionpbx
|
||||
chmod -R 755 /var/www/fusionpbx/secure
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ cd "$(dirname "$0")"
|
|||
echo "Install PostgreSQL"
|
||||
|
||||
#generate a random password
|
||||
password=$(cat /dev/random | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 16)
|
||||
password=$(cat /dev/random | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 20)
|
||||
|
||||
#install message
|
||||
echo "Install PostgreSQL and create the database and users\n"
|
||||
|
|
@ -42,7 +42,7 @@ service postgresql restart
|
|||
#install the database backup
|
||||
#cp backup/fusionpbx-backup.sh /etc/cron.daily
|
||||
#chmod 755 /etc/cron.daily/fusionpbx-backup.sh
|
||||
#sed -i "s/zzz/$password/g" /etc/cron.daily/fusionpbx-backup.sh
|
||||
#sed -i' ' -e "s/zzz/$password/g" /etc/cron.daily/fusionpbx-backup.sh
|
||||
|
||||
#move to /tmp to prevent an error when running sudo with psql
|
||||
cwd=$(pwd)
|
||||
|
|
|
|||
Loading…
Reference in New Issue