From fcd6dd6c4c814e495aafaae0b25c9eaa8a849331 Mon Sep 17 00:00:00 2001 From: Maniacikarus Date: Sun, 7 Dec 2008 18:53:19 +0100 Subject: [PATCH] Added fetchmail pak routines to backup before upgrading --- src/paks/fetchmail/install.sh | 27 +++++++++++++++++++++++++++ src/paks/fetchmail/uninstall.sh | 27 +++++++++++++++++++++++++++ src/paks/fetchmail/update.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 src/paks/fetchmail/install.sh create mode 100644 src/paks/fetchmail/uninstall.sh create mode 100644 src/paks/fetchmail/update.sh diff --git a/src/paks/fetchmail/install.sh b/src/paks/fetchmail/install.sh new file mode 100644 index 0000000000..31c5fecae2 --- /dev/null +++ b/src/paks/fetchmail/install.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} +start_service --background ${NAME} diff --git a/src/paks/fetchmail/uninstall.sh b/src/paks/fetchmail/uninstall.sh new file mode 100644 index 0000000000..a7b8a5370f --- /dev/null +++ b/src/paks/fetchmail/uninstall.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +stop_service ${NAME} +make_backup ${NAME} +remove_files diff --git a/src/paks/fetchmail/update.sh b/src/paks/fetchmail/update.sh new file mode 100644 index 0000000000..cb88e34788 --- /dev/null +++ b/src/paks/fetchmail/update.sh @@ -0,0 +1,32 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2008 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh + +#Create a backupinclude if it not exist +if [ ! -e "/var/ipfire/backup/addons/includes/fetchmail" ]; then + echo "/root/.fetchmailrc" > /var/ipfire/backup/addons/includes/fetchmail +fi + +./uninstall.sh +./install.sh -- 2.39.2