File: enable-ipv6

package info (click to toggle)
uruk 20190121-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,188 kB
  • sloc: sh: 1,852; makefile: 151; xml: 51
file content (37 lines) | stat: -rw-r--r-- 786 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

# this file maintained at http://git.mdcc.cx/uruk.git

# uruk/init/enable-ipv6 - should uruk run ip6tables too?

# Copyright © 2012 Wessel Dankers
# Copyright © 2012 Joost van Baal-Ilić

# usage: in /etc/default/uruk, write:
#
#   enable_ipv6=$(enable-ipv6)
#   if $enable_ipv6; then dostuff; fi

# based upon "group/uruk/etc/default" by Wessel Dankers, 2012

enable_ipv6=false

for f in /etc/sysconfig/network-scripts/ifcfg-*
do
   test -f "$f" || continue
   case $(unset IPV6INIT; . $f && echo $IPV6INIT) in yes)
      enable_ipv6=true
   esac
done

if test -f /etc/network/interfaces
then
   while read -r verb iface family mode
   do
      case $verb,$family in iface,inet6)
         enable_ipv6=true
      esac
   done </etc/network/interfaces
fi

echo $enable_ipv6