mirror of https://gitlab.com/hp3icc/emq-TE1.git
Update ipv6on.sh
This commit is contained in:
parent
9386f3032a
commit
cc8ef82d67
|
|
@ -1,4 +1,7 @@
|
|||
#!/bin/bash
|
||||
cat > /bin/ipv6on <<- "EOF"
|
||||
#!/bin/bash
|
||||
|
||||
# Verificar si el usuario tiene permisos de root
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "Este script debe ejecutarse como usuario ROOT"
|
||||
|
|
@ -9,6 +12,7 @@ fi
|
|||
echo "Activando y habilitando IPv6..."
|
||||
|
||||
# Modificar sysctl.conf para habilitar IPv6
|
||||
sed -i '/net.ipv6.conf.eth0.disable_ipv6/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv6.conf.all.disable_ipv6/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv6.conf.default.disable_ipv6/d' /etc/sysctl.conf
|
||||
sed -i '/net.ipv6.conf.lo.disable_ipv6/d' /etc/sysctl.conf
|
||||
|
|
@ -16,6 +20,7 @@ sed -i '/net.ipv6.conf.lo.disable_ipv6/d' /etc/sysctl.conf
|
|||
echo "net.ipv6.conf.all.disable_ipv6 = 0" >> /etc/sysctl.conf
|
||||
echo "net.ipv6.conf.default.disable_ipv6 = 0" >> /etc/sysctl.conf
|
||||
echo "net.ipv6.conf.lo.disable_ipv6 = 0" >> /etc/sysctl.conf
|
||||
#echo "net.ipv6.conf.eth0.disable_ipv6 = 1" >> /etc/sysctl.conf
|
||||
|
||||
# Aplicar los cambios de sysctl
|
||||
sysctl -p
|
||||
|
|
@ -24,9 +29,16 @@ sysctl -p
|
|||
sed -i 's/ipv6.disable=1//g' /etc/default/grub
|
||||
update-grub
|
||||
|
||||
#reboot
|
||||
# Reiniciar para aplicar los cambios
|
||||
echo "Reiniciando el sistema para aplicar los cambios..."
|
||||
whiptail --title "Reinicio Requerido" --msgbox "* Debe reiniciar para aplicar los cambios.\n\nPresione Enter para reiniciar el equipo.\n\n\n* Need to reboot to apply the changes\n\nPress Enter to restart your computer" 15 60
|
||||
|
||||
# Reiniciar para aplicar los cambios
|
||||
echo "Reboot..."
|
||||
sudo reboot
|
||||
|
||||
EOF
|
||||
|
||||
sudo chmod +x /bin/ipv6on
|
||||
ipv6on
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue