Fix the fusionpbx git pull

This commit is contained in:
Mark J Crane
2017-03-26 13:24:16 -06:00
parent 3d9287de66
commit c83134b436
3 changed files with 8 additions and 13 deletions

View File

@@ -13,7 +13,7 @@ database_host=127.0.0.1
database_port=5432 database_port=5432
database_username=fusionpbx database_username=fusionpbx
if [ .$database_password = .'random' ]; then 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 fi
#allow the script to use the new password #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_salt=$(/usr/bin/php /var/www/fusionpbx/resources/uuid.php);
user_name=$system_username user_name=$system_username
if [ .$system_password = .'random' ]; then 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 else
user_password=$system_password user_password=$system_password
fi 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 cd /var/www/fusionpbx && php /var/www/fusionpbx/core/upgrade/upgrade_domains.php
#restart freeswitch #restart freeswitch
/bin/systemctl daemon-reload service freeswitch restart
/bin/systemctl restart freeswitch
#welcome message #welcome message
echo "" echo ""

View File

@@ -5,27 +5,23 @@ cd "$(dirname "$0")"
. ./config.sh . ./config.sh
. ./colors.sh . ./colors.sh
. ./environment.sh
#send a message #send a message
verbose "Installing FusionPBX" verbose "Installing FusionPBX"
#install dependencies #install dependencies
apt-get install -y --force-yes vim git dbus haveged ssl-cert pkg install --yes git ghostscript9-base tiff
apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools
if [ .$system_branch = "master" ]; then if [ .$system_branch = "master" ]; then
verbose "Using master" verbose "Using master"
branch="" branch=""
else 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_version=4.2
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
verbose "Using version $system_version" verbose "Using version $system_version"
branch="-b $system_version" branch="-b $system_version"
fi fi
#get the source code #get the source code
git clone $branch https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx 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 chmod -R 755 /var/www/fusionpbx/secure

View File

@@ -11,7 +11,7 @@ cd "$(dirname "$0")"
echo "Install PostgreSQL" echo "Install PostgreSQL"
#generate a random password #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 #install message
echo "Install PostgreSQL and create the database and users\n" echo "Install PostgreSQL and create the database and users\n"
@@ -42,7 +42,7 @@ service postgresql restart
#install the database backup #install the database backup
#cp backup/fusionpbx-backup.sh /etc/cron.daily #cp backup/fusionpbx-backup.sh /etc/cron.daily
#chmod 755 /etc/cron.daily/fusionpbx-backup.sh #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 #move to /tmp to prevent an error when running sudo with psql
cwd=$(pwd) cwd=$(pwd)