]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/pakfire/lib/functions.sh
28ede3ce2a55483259d4893b6e60b23dc3ca6e90
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
26 echo "Extracting files..."
27 tar xvf
/opt
/pakfire
/tmp
/files
--preserve --numeric-owner -C /
32 echo "Removing files..."
33 for i
in $
(cat /opt
/pakfire
/tmp
/ROOTFILES
); do
40 if [ -e "/var/ipfire/backup/addons/includes/${1}" ];then
41 echo "Creating Backup..."
42 /usr
/local
/bin
/backupctrl addonbackup
${1}
48 if [ -e "/var/ipfire/backup/addons/backup/${1}.ipf" ];then
49 echo "Restoring Backup..."
50 /usr
/local
/bin
/backupctrl restoreaddon
${1}.ipf
56 /etc
/init.d
/${1} restart
73 log_failure_msg
"Unknown Option: ${1}"
74 return 2 #invalid or excess argument(s)
82 if [ -e "/etc/init.d/${1}" ];then
84 /etc
/init.d
/${1} start
${BACKGROUND}
89 if [ -e "/etc/init.d/${1}" ];then