Project

General

Profile

Download (1.36 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/bin/sh
2
#
3
# rc.gateway_alarm
4
#
5
# Copyright (c) 2015-2018 Rubicon Communications, LLC (Netgate). All rights reserved.
6
#
7
# Licensed under the Apache License, Version 2.0 (the "License");
8
# you may not use this file except in compliance with the License.
9
# You may obtain a copy of the License at
10
#
11
# http://www.apache.org/licenses/LICENSE-2.0
12
#
13
# Unless required by applicable law or agreed to in writing, software
14
# distributed under the License is distributed on an "AS IS" BASIS,
15
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
# See the License for the specific language governing permissions and
17
# limitations under the License.
18

    
19
GW="$1"
20
alarm_addr="$2"
21
alarm_flag="$3"
22
alarm_rtt="$4"
23
alarm_rttsd="$5"
24
alarm_loss="$6"
25

    
26
if [ -z "$GW" ]; then
27
	exit 1
28
fi
29

    
30
echo ">>> Gateway alarm: ${GW} (Addr:${alarm_addr} Alarm:${alarm_flag} RTT:${alarm_rtt}ms RTTsd:${alarm_rttsd}ms Loss:${alarm_loss}%)" | /usr/bin/logger -p daemon.info -i -t rc.gateway_alarm
31

    
32
/usr/local/sbin/pfSctl \
33
	-c "service reload dyndns ${GW}" \
34
	-c "service reload ipsecdns" \
35
	-c "service reload openvpn ${GW}" \
36
	-c "filter reload" >/dev/null 2>&1
37

    
38
# after above signal the check_reload_status process calls the following scripts simultaneously.:
39
# - "/etc/rc.dyndns.update", "dyndns=%s"
40
# - "/etc/rc.newipsecdns"
41
# - "/etc/rc.openvpn", "interface=%s"
42
# - "/etc/rc.filter_configure_sync"
43

    
44
exit $?
(35-35/79)