initial commit of file from CVS for smeserver-freepbx on Sat Sep 7 20:25:35 AEST 2024
This commit is contained in:
20
root/etc/e-smith/events/actions/freepbx-backup
Normal file
20
root/etc/e-smith/events/actions/freepbx-backup
Normal 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
|
Reference in New Issue
Block a user