]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - config/rootfiles/core/106/update.sh
Remove IPAC stuff
[people/pmueller/ipfire-2.x.git] / config / rootfiles / core / 106 / update.sh
CommitLineData
c4a1169e
MT
1#!/bin/bash
2############################################################################
3# #
4# This file is part of the IPFire Firewall. #
5# #
6# IPFire is free software; you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation; either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# IPFire is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with IPFire; if not, write to the Free Software #
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
19# #
20# Copyright (C) 2016 IPFire-Team <info@ipfire.org>. #
21# #
22############################################################################
23#
24. /opt/pakfire/lib/functions.sh
25/usr/local/bin/backupctrl exclude >/dev/null 2>&1
26
59bddc79 27core=106
c4a1169e
MT
28
29function exit_with_error() {
30 # Set last succesfull installed core.
31 echo $(($core-1)) > /opt/pakfire/db/core/mine
32 /usr/bin/logger -p syslog.emerg -t ipfire \
33 "core-update-${core}: $1"
34 exit $2
35}
36
37# Remove old core updates from pakfire cache to save space...
59bddc79 38for (( i=1; i<=$core; i++ )); do
c4a1169e
MT
39 rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire
40done
41
42
43# Stop services
e26a9332
MT
44/etc/init.d/squid stop
45/etc/init.d/ipsec stop
46/etc/init.d/dnsmasq stop
c4a1169e
MT
47
48# Extract files
49extract_files
50
e26a9332
MT
51# Delete dnsmasq
52rm -vf \
53 /etc/rc.d/init.d/dnsmasq \
54 /etc/rc.d/init.d/networking/red.down/05-RS-dnsmasq \
55 /etc/rc.d/init.d/networking/red.up/05-RS-dnsmasq \
56 /usr/sbin/dnsmasq
57
5edc06b7
MT
58# Delete old net-traffic stuff
59rm -vrf \
60 /etc/rc.d/helper/writeipac.pl \
61 /etc/rc.d/init.d/networking/red.up/40-ipac \
62 /var/ipfire/net-traffic \
63 /var/log/net-traffic.log*
64
c4a1169e
MT
65# update linker config
66ldconfig
67
e26a9332
MT
68grep -q unbound-anchor /var/spool/cron/root.orig || cat <<EOF >> /var/spool/cron/root.orig
69
70# Update DNS trust anchor
71%daily,random * * @runas(nobody) /usr/sbin/unbound-anchor -a /var/lib/unbound/root.key -c /etc/unbound/icannbundle.pem
72EOF
73
c4a1169e 74# Update Language cache
e26a9332 75/usr/local/bin/update-lang-cache
c4a1169e
MT
76
77# Start services
e26a9332
MT
78/etc/init.d/unbound start
79/etc/init.d/squid start
80if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then
81 /etc/init.d/ipsec start
82fi
c4a1169e
MT
83
84# This update need a reboot...
85touch /var/run/need_reboot
86
87# Finish
88/etc/init.d/fireinfo start
89sendprofile
90
91# Update grub config to display new core version
92if [ -e /boot/grub/grub.cfg ]; then
93 grub-mkconfig -o /boot/grub/grub.cfg
94fi
95sync
96
97# Don't report the exitcode last command
98exit 0