Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/E-F-A/v4
Browse files Browse the repository at this point in the history
  • Loading branch information
shawniverson committed Nov 22, 2021
2 parents c25100d + 081387d commit cae6ed6
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 10 deletions.
4 changes: 4 additions & 0 deletions rpmbuild/SOURCES/eFa-4.0.4/eFa/eFa-Backup.cron
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# +--------------------------------------------------------------------+

# Exit if backup disabled
[[ -f /etc/eFa/eFa-Backup.disabled ]] && exit 0

[[ -f /var/log/eFa/eFa-Backup.log ]] || touch /var/log/eFa/eFa-Backup.log
/usr/sbin/eFa-Backup-cron -backup >> /var/log/eFa/eFa-Backup.log 2>&1
/usr/sbin/eFa-Backup-cron -purge >> /var/log/eFa/eFa-Backup.log 2>&1
22 changes: 12 additions & 10 deletions rpmbuild/SOURCES/eFa-4.0.4/eFa/eFa-Configure
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ shopt -s extglob
. /var/eFa/lib/eFa-Configure/func_webmin
. /var/eFa/lib/eFa-Configure/func_maxmind
. /var/eFa/lib/eFa-Configure/func_fail2ban
. /var/eFa/lib/eFa-Configure/func_backup
# +---------------------------------------------------+

# +---------------------------------------------------+
Expand All @@ -80,16 +81,16 @@ show_menu() {
echo -e ""
echo -e "Please choose an option:"
echo -e " "
echo -e "0) Logout from ssh 9) MariaDB Recovery"
echo -e "1) Shell 10) Apache Settings"
echo -e "2) Reboot system 11) Virus Settings"
echo -e "3) Halt system 12) System Restore"
echo -e "4) IP Settings 13) Update Now"
echo -e "5) Tunables 14) Maintenance Mode"
echo -e "6) MailWatch Settings 15) Let's Encrypt"
echo -e "7) Mail Settings 16) DKIM and DMARC"
echo -e "8) Spam Settings 17) Webmin"
echo -e " 18) Fail2Ban"
echo -e "0) Logout from ssh 10) Apache Settings"
echo -e "1) Shell 11) Virus Settings"
echo -e "2) Reboot system 12) System Restore"
echo -e "3) Halt system 13) Update Now"
echo -e "4) IP Settings 14) Maintenance Mode"
echo -e "5) Tunables 15) Let's Encrypt"
echo -e "6) MailWatch Settings 16) DKIM and DMARC"
echo -e "7) Mail Settings 17) Webmin"
echo -e "8) Spam Settings 18) Fail2Ban"
echo -e "9) MariaDB Recovery 19) Auto-Backup settings"
echo -e -n "$green[eFa]$clean : "
local choice
read choice
Expand All @@ -113,6 +114,7 @@ show_menu() {
16) func_dkim-dmarc ;;
17) func_webmin ;;
18) func_fail2ban ;;
19) func_backup-settings ;;
*) echo -e "Error \"$choice\" is not an option..." && sleep 2
esac
done
Expand Down
69 changes: 69 additions & 0 deletions rpmbuild/SOURCES/eFa-4.0.4/eFa/lib-eFa-Configure/func_backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# +---------------------------------------------------+
# Function to toggle eFa daily backups
# +---------------------------------------------------+
func_backup-settings() {
TOUCHFILE=/etc/eFa/eFa-Backup.disabled
func_echo-header
echo -e "$green[eFa]$clean - Automatic daily backups"
echo -e ""
echo -e "$green[eFa]$clean This option will toggle automatic backups"
echo -e ""
[[ -f $TOUCHFILE ]] && backupStatus="0" || backupStatus="1"

if [[ "$backupStatus" -eq "1" ]]; then
echo -en "$green[eFa]$clean : Disable eFa automatic daily backups? (y/N/c):"
read BACKUP

FLAG=1
while [ $FLAG -eq 1 ]
do
if [[ $BACKUP =~ ^[yY]$ ]]; then
touch $TOUCHFILE
echo -e ""
echo -e "$green[eFa]$clean Automatic daily backups is $green DISABLED $clean"
echo -e ""
FLAG=0
elif [[ -z "$BACKUP" || $BACKUP =~ ^[nN]$ ]]; then
echo -e ""
echo -e "$green[eFa]$clean No action taken"
FLAG=0
elif [[ $BACKUP =~ ^[cC]$ ]]; then
echo -e "$green[eFa]$clean No action taken, exiting."
FLAG=0
else
echo -e "$red[ERROR]$clean Invalid input"
echo -en "$green[eFa]$clean : Disable eFa automatic daily backups? (y/N/c):"
read BACKUP
fi
done
else
echo -en "$green[eFa]$clean : Enable eFa automatic daily backups? (y/N/c):"
read BACKUP

FLAG=1
while [ $FLAG -eq 1 ]
do
if [[ -z "$BACKUP" || $BACKUP =~ ^[yY]$ ]]; then
[[ -f $TOUCHFILE ]] && rm -f $TOUCHFILE
echo -e ""
echo -e "$green[eFa]$clean Automatic daily backups is $green ENABLED $clean"
echo -e ""
FLAG=0
elif [[ $BACKUP =~ ^[nN]$ ]]; then
echo -e ""
echo -e "$green[eFa]$clean No action taken"
FLAG=0
elif [[ $BACKUP =~ ^[cC]$ ]]; then
echo -e "$green[eFa]$clean No action taken, exiting."
FLAG=0
else
echo -e "$red[ERROR]$clean Invalid input"
echo -en "$green[eFa]$clean : Enable eFa automatic daily backups? (y/N/c):"
read BACKUP
fi
done
fi
pause

}
# +---------------------------------------------------+

0 comments on commit cae6ed6

Please sign in to comment.