From: Michael Tremer Date: Tue, 30 Oct 2018 17:20:37 +0000 (+0000) Subject: frr: Install users and make backup when package is installed/uinstalled X-Git-Tag: v2.21-core125~25^2~8^2~6^2~3 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=a90f7faf78e8d7a4220d4be51f6eb1b3f726e657;ds=sidebyside frr: Install users and make backup when package is installed/uinstalled Signed-off-by: Michael Tremer --- diff --git a/src/paks/frr/install.sh b/src/paks/frr/install.sh new file mode 100644 index 0000000000..60d77a0156 --- /dev/null +++ b/src/paks/frr/install.sh @@ -0,0 +1,45 @@ +#!/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 + +if ! getent group frr &>/dev/null; then + groupadd -r frr +fi + +if ! getent group frrvty &>/dev/null; then + groupadd -r frrvty +fi + +if ! getent passwd frr &>/dev/null; then + useradd -r frr -g frr -s /bin/false -b /var/empty -G frrvty +fi + +# Extract files +extract_files + +# Restore any backups +restore_backup "${NAME}" + +# Start services +start_service "${NAME}" diff --git a/src/paks/frr/uninstall.sh b/src/paks/frr/uninstall.sh new file mode 100644 index 0000000000..49e3fdd7d1 --- /dev/null +++ b/src/paks/frr/uninstall.sh @@ -0,0 +1,35 @@ +#!/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 services +stop_service "${NAME}" + +# Create backup +extract_backup_includes +make_backup "${NAME}" + +# Remove all files +rm -rfv /etc/rc.d/rc*.d/*frr +remove_files diff --git a/src/paks/frr/update.sh b/src/paks/frr/update.sh new file mode 100644 index 0000000000..89c40d0d7c --- /dev/null +++ b/src/paks/frr/update.sh @@ -0,0 +1,26 @@ +#!/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 +./uninstall.sh +./install.sh