initial commit of file from CVS for smeserver-freepbx on Sat Sep 7 20:25:35 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:25:35 +10:00
parent bd24175623
commit 190a3e0d7a
80 changed files with 3092 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/bash
#version
version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/backup/module.xml|cut -d. -f1)
#if version >=15
if [[ $version -ge 15 ]]
then
#backup id SELECT `id` FROM `kvstore_FreePBX_modules_Backup` WHERE `key` LIKE 'backup_name' and `val` LIKE 'Default-backup';
backupid=$(echo 'SELECT `id` FROM `kvstore_FreePBX_modules_Backup` WHERE `key` LIKE "backup_name" and `val` LIKE "Default-backup"'| mysql -u root freepbxdb -s)
#if backupid empty need to set one of manually backup something
if [ -z $backupid ] ; then
echo "missing backupid, we create the db entries"
/etc/e-smith/events/actions/freepbx-checkinstall-backup pre-backup
fi
echo "backup for freepbx version 15 or above"
/usr/sbin/fwconsole bu --backup $backupid 1>/dev/null
else
echo "backup for freepbx version 14 or below"
su asterisk -s /bin/bash -c '/usr/sbin/php56 /var/lib/asterisk/bin/backup.php --id=1'
fi