summaryrefslogtreecommitdiff
path: root/scripts/check-params-on-reboot.d/ipv6_disable_blacklist
blob: 2fcb762a8f445e3094b8b9bb2fc729342bf66ebf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#
# fix IPv6 disable/blacklist on reboot
#

BOOTFILE=$1

cli-shell-api cfExists $BOOTFILE system ipv6 disable
ipv6_disable_cfg=`echo $?`
if [ "$ipv6_disable_cfg" == "0" ]; then
        sudo sh -c "echo options ipv6 disable_ipv6=1 > \
                /etc/modprobe.d/vyatta_disable_ipv6.conf"
else
        sudo sh -c "rm -f /etc/modprobe.d/vyatta_disable_ipv6.conf"
fi

cli-shell-api cfExists $BOOTFILE system ipv6 blacklist
ipv6_blacklist_cfg=`echo $?`
if [ "$ipv6_blacklist_cfg" == "0" ]; then
        sudo sh -c "echo blacklist ipv6 > \
                /etc/modprobe.d/vyatta_blacklist_ipv6.conf"
else
        sudo sh -c "rm -f /etc/modprobe.d/vyatta_blacklist_ipv6.conf"
fi