]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/pakfire/lib/functions.sh
25bd4be1e02daa9052d335503fbc1e95a8e77c8f
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
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 ###############################################################################
30 --preserve-permissions
35 echo "Extracting files..."
36 tar -xavf /opt
/pakfire
/tmp
/files
* "${TAR_OPTIONS[@]}" -C /
40 extract_backup_includes
() {
41 echo "Extracting backup includes..."
42 tar xavf
/opt
/pakfire
/tmp
/files
* "${TAR_OPTIONS[@]}" -C / \
43 var
/ipfire
/backup
/addons
/includes
48 echo "Removing files..."
49 for i
in $
(cat /opt
/pakfire
/db
/rootfiles
/${NAME}); do
56 if [ -e "/var/ipfire/backup/addons/includes/${1}" ]; then
57 echo "Creating Backup..."
58 /usr
/local
/bin
/backupctrl addonbackup
${1}
64 if [ -e "/var/ipfire/backup/addons/backup/${1}.ipf" ]; then
65 echo "Restoring Backup..."
66 /usr
/local
/bin
/backupctrl restoreaddon
${1}.ipf
72 /etc
/init.d
/${1} restart
89 log_failure_msg
"Unknown Option: ${1}"
90 return 2 #invalid or excess argument(s)
98 if [ -f "/etc/init.d/${1}" ]; then
99 if [ -n "${BACKGROUND}" ]; then
100 (sleep ${DELAY} && /etc
/init.d
/${1} start
) &
102 sleep ${DELAY} && /etc
/init.d
/${1} start
108 if [ -f "/etc/init.d/${1}" ]; then
109 /etc
/init.d
/${1} stop
113 rebuild_langcache
() {
114 echo "Rebuilding language cache..."
115 perl
-e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"