mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 13:01:52 -07:00
Update add_ipv6.sh
This commit is contained in:
parent
790b4aeb51
commit
482e19b06f
1 changed files with 16 additions and 8 deletions
|
@ -1,9 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
source /etc/profile.d/vesta.sh
|
source /etc/profile.d/vesta.sh
|
||||||
|
source /usr/local/vesta/func/main.sh
|
||||||
#download new templates
|
|
||||||
$BIN/v-update-web-templates
|
|
||||||
$BIN/v-update-dns-templates
|
|
||||||
|
|
||||||
#Download firewallv6 templates
|
#Download firewallv6 templates
|
||||||
if [ ! -e "$VESTA/data/firewallv6" ]; then
|
if [ ! -e "$VESTA/data/firewallv6" ]; then
|
||||||
|
@ -16,15 +13,21 @@ if [ ! -e "$VESTA/data/firewallv6" ]; then
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#set IPv4 version
|
||||||
|
iplist=$(ls --sort=time $VESTA/data/ips/)
|
||||||
|
for ip in $iplist; do
|
||||||
|
echo "VERSION='4'" >> $VESTA/data/ips/$ip
|
||||||
|
done
|
||||||
|
|
||||||
#Add IP6 field
|
#Add IP6 field
|
||||||
ipv6=$(ip addr show | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d' | grep -ve "^fe80" | tail -1)
|
ipv6=$(ip addr show | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d' | grep -ve "^fe80" | tail -1)
|
||||||
ipv6use=""
|
ipv6use=""
|
||||||
if [ ! -z "$ipv6" ]; then
|
if [ ! -z "$ipv6" ] && [ "::1" != "$ipv6" ]; then
|
||||||
netmask="ip addr show | grep '$ipv6' | awk -F '/' '{print $2}' | awk '{print $1}'"
|
netmask="ip addr show | grep '$ipv6' | awk -F '/' '{print \$2}' | awk '{print \$1}'"
|
||||||
netmask=$(eval $netmask)
|
netmask=$(eval $netmask)
|
||||||
$BIN/v-add-sys-ipv6 $ipv6 $netmask
|
$VESTA/bin/v-add-sys-ipv6 $ipv6 $netmask
|
||||||
$BIN/v-update-firewall-ipv6
|
$BIN/v-update-firewall-ipv6
|
||||||
ipv6use=ipv6
|
ipv6use=$ipv6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#set IPv6
|
#set IPv6
|
||||||
|
@ -52,4 +55,9 @@ for user in $userlist; do
|
||||||
$BIN/v-rebuild-user $user
|
$BIN/v-rebuild-user $user
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
#download new templates
|
||||||
|
$BIN/v-update-web-templates
|
||||||
|
$BIN/v-update-dns-templates
|
||||||
|
|
||||||
/usr/local/vesta/bin/v-add-user-notification admin "IPv6 support" "Your vesta installation supports IPv6!"
|
/usr/local/vesta/bin/v-add-user-notification admin "IPv6 support" "Your vesta installation supports IPv6!"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue