From f65d5de1d9ec252ba76be348885e1dee703d6fe2 Mon Sep 17 00:00:00 2001 From: Script Proyect by HP3ICC Date: Mon, 19 Aug 2024 14:07:23 +0000 Subject: [PATCH] Add new file --- install/ipv6on-custom.sh | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 install/ipv6on-custom.sh diff --git a/install/ipv6on-custom.sh b/install/ipv6on-custom.sh new file mode 100644 index 0000000..1c371a3 --- /dev/null +++ b/install/ipv6on-custom.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# Verificar si el usuario tiene permisos de root +if [[ $EUID -ne 0 ]]; then + echo "Este script debe ejecutarse como usuario ROOT" + exit 1 +fi + +# Activar y habilitar IPv6 en el sistema +echo "Activando y habilitando IPv6..." + +# Modificar sysctl.conf para habilitar IPv6 +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 + +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 + +sudo grep -qxF 'net.ipv6.conf.eth0.disable_ipv6 = 1' /etc/sysctl.conf || echo 'net.ipv6.conf.eth0.disable_ipv6 = 1' | sudo tee -a /etc/sysctl.conf + +# Aplicar los cambios de sysctl +sysctl -p + +# Habilitar IPv6 en GRUB +sed -i 's/ipv6.disable=1//g' /etc/default/grub +update-grub + +# Reiniciar para aplicar los cambios +echo "Reiniciando el sistema para aplicar los cambios..." +#reboot +cat > /tmp/completado.sh <<- "EOF" +#!/bin/bash +while : ; do +choix=$(whiptail --title "Script Proyect HP3ICC Esteban Mackay 73." --menu "Al finalizar el reinicio escriba menu-adn2 para configurar su servidor. / At the end of the reboot type menu-adn2 to configure your server." 13 46 2 \ +1 " Iniciar Reinicio / Start Reboot " 3>&1 1>&2 2>&3) +exitstatus=$? +#on recupere ce choix +#exitstatus=$? +if [ $exitstatus = 0 ]; then + echo "Your chosen option:" $choix +else + echo "You chose cancel."; break; +fi +# case : action en fonction du choix +case $choix in +1) +sudo reboot +;; +esac +done +exit 0 +EOF +################################# +sudo chmod +x /tmp/completado.sh +#history -c && history -w +sh /tmp/completado.sh +