From: arne_f Date: Sat, 23 Feb 2008 21:33:14 +0000 (+0000) Subject: added backup of teamspeak database to pak X-Git-Tag: v2.3-beta1~175 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=5c981649bf6fbd9d15e2810f3ef85b704ab0e671 added backup of teamspeak database to pak configured addonsvc as a pak git-svn-id: http://svn.ipfire.org/svn/ipfire/branches/2.1/trunk@1232 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- diff --git a/config/backup/includes/teamspeak b/config/backup/includes/teamspeak new file mode 100644 index 0000000000..13705d31e9 --- /dev/null +++ b/config/backup/includes/teamspeak @@ -0,0 +1,7 @@ +/opt/teamspeak/bad_names.txt +/opt/teamspeak/server.dbs +/opt/teamspeak/server.ini +/opt/teamspeak/server.log +/opt/teamspeak/whitelist.txt + + diff --git a/config/rootfiles/packages/addonsvc b/config/rootfiles/packages/addonsvc new file mode 100644 index 0000000000..404821f59d --- /dev/null +++ b/config/rootfiles/packages/addonsvc @@ -0,0 +1,3 @@ +usr/local/bin/addonctrl +srv/web/ipfire/cgi-bin/addonsvc.cgi +var/ipfire/menu.d/EX-addonsvc.menu diff --git a/lfs/addonsvc b/lfs/addonsvc new file mode 100644 index 0000000000..cb52bc6dd2 --- /dev/null +++ b/lfs/addonsvc @@ -0,0 +1,58 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program 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 3 of the License, or # +# (at your option) any later version. # +# # +# This program 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 this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = ipfire + +THISAPP = addonsvc-$(VER) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +PROG = addonsvc +PAK_VER = 1 + +DEPS = "" + +############################################################################### +# Top-level Rules +############################################################################### + +install : $(TARGET) + +check : + +download : + +md5 : + +dist: + @$(PAK) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @$(POSTBUILD) diff --git a/src/initscripts/init.d/teamspeak b/src/initscripts/init.d/teamspeak index 9f63a0a256..fde1696e56 100644 --- a/src/initscripts/init.d/teamspeak +++ b/src/initscripts/init.d/teamspeak @@ -14,5 +14,5 @@ export LANG=en_US.utf8 cd /opt/teamspeak && sudo -u teamspeak ./teamspeak2-server_startscript $* - +exit 0 # End $rc_base/init.d/teamspeak diff --git a/src/paks/teamspeak/install.sh b/src/paks/teamspeak/install.sh index 16333af374..7e8a5c1793 100644 --- a/src/paks/teamspeak/install.sh +++ b/src/paks/teamspeak/install.sh @@ -44,8 +44,11 @@ useradd -g teamspeak teamspeak chown teamspeak.teamspeak /opt/teamspeak -Rv +restore_backup ${NAME} start_service --background ${NAME} ln -sf ../init.d/teamspeak /etc/rc.d/rc0.d/K00teamspeak ln -sf ../init.d/teamspeak /etc/rc.d/rc3.d/S99teamspeak ln -sf ../init.d/teamspeak /etc/rc.d/rc6.d/K00teamspeak + + diff --git a/src/paks/teamspeak/uninstall.sh b/src/paks/teamspeak/uninstall.sh index 583f97ef43..d8010b0adc 100644 --- a/src/paks/teamspeak/uninstall.sh +++ b/src/paks/teamspeak/uninstall.sh @@ -23,6 +23,17 @@ # . /opt/pakfire/lib/functions.sh stop_service ${NAME} + +if [ ! -e "/var/ipfire/backup/addons/includes/teamspeak ]; then + echo /opt/teamspeak/bad_names.txt > /var/ipfire/backup/addons/includes/teamspeak + echo /opt/teamspeak/server.dbs >> /var/ipfire/backup/addons/includes/teamspeak + echo /opt/teamspeak/server.ini >> /var/ipfire/backup/addons/includes/teamspeak + echo /opt/teamspeak/server.log >> /var/ipfire/backup/addons/includes/teamspeak + echo /opt/teamspeak/whitelist.txt >> /var/ipfire/backup/addons/includes/teamspeak +fi +make_backup ${NAME} rm -rf /opt/teamspeak userdel teamspeak rm -rf /etc/rc.d/rc*.d/*teamspeak + +