1 |
7a012bff
|
Renato Botelho
|
#!/bin/sh
|
2 |
|
|
#
|
3 |
|
|
# rc.gateway_alarm
|
4 |
|
|
#
|
5 |
b8f91b7c
|
Luiz Souza
|
# Copyright (c) 2015-2018 Rubicon Communications, LLC (Netgate). All rights reserved.
|
6 |
7a012bff
|
Renato Botelho
|
#
|
7 |
b12ea3fb
|
Renato Botelho
|
# 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 |
7a012bff
|
Renato Botelho
|
#
|
11 |
b12ea3fb
|
Renato Botelho
|
# http://www.apache.org/licenses/LICENSE-2.0
|
12 |
7a012bff
|
Renato Botelho
|
#
|
13 |
b12ea3fb
|
Renato Botelho
|
# 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 |
7a012bff
|
Renato Botelho
|
|
19 |
|
|
GW="$1"
|
20 |
48196bf0
|
PiBa-NL
|
alarm_addr="$2"
|
21 |
|
|
alarm_flag="$3"
|
22 |
|
|
alarm_rtt="$4"
|
23 |
|
|
alarm_rttsd="$5"
|
24 |
|
|
alarm_loss="$6"
|
25 |
7a012bff
|
Renato Botelho
|
|
26 |
|
|
if [ -z "$GW" ]; then
|
27 |
|
|
exit 1
|
28 |
|
|
fi
|
29 |
|
|
|
30 |
48196bf0
|
PiBa-NL
|
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 |
7a012bff
|
Renato Botelho
|
/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 |
48196bf0
|
PiBa-NL
|
# 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 |
7a012bff
|
Renato Botelho
|
exit $?
|