From 501e7b8654263f6758e273162f09183661d40303 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 13 Feb 2014 15:39:35 +0100 Subject: [PATCH] tor: Bump package version to 6 and fix backup. The backup include file is missing in older releases and will be created on the fly when updating old packages. --- lfs/tor | 2 +- src/paks/tor/install.sh | 27 +++++++++++++++++++++++++++ src/paks/tor/uninstall.sh | 27 +++++++++++++++++++++++++++ src/paks/tor/update.sh | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 src/paks/tor/install.sh create mode 100644 src/paks/tor/uninstall.sh create mode 100644 src/paks/tor/update.sh diff --git a/lfs/tor b/lfs/tor index 9669ea74e..79567366a 100644 --- a/lfs/tor +++ b/lfs/tor @@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = tor -PAK_VER = 5 +PAK_VER = 6 DEPS = "libevent2" diff --git a/src/paks/tor/install.sh b/src/paks/tor/install.sh new file mode 100644 index 000000000..31c5fecae --- /dev/null +++ b/src/paks/tor/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/tor/uninstall.sh b/src/paks/tor/uninstall.sh new file mode 100644 index 000000000..a7b8a5370 --- /dev/null +++ b/src/paks/tor/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/tor/update.sh b/src/paks/tor/update.sh new file mode 100644 index 000000000..675e7f556 --- /dev/null +++ b/src/paks/tor/update.sh @@ -0,0 +1,37 @@ +#!/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 + +# Create backup include file if it is missing. +if [ ! -e "/var/ipfire/backup/addons/includes/tor" ]; then + cat < /var/ipfire/backup/addons/includes/tor +/etc/tor +/var/ipfire/tor +/var/lib/tor/fingerprint +/var/lib/tor/keys +EOF +fi + +./uninstall.sh +./install.sh -- 2.39.2