Horzagger

DNS LOOP CHANGER

Sep 24th, 2020
1,247
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3.  
  4. ## This simple shell script is a "DNS LOOP CHANGER" to change the DNS of the Linux operating system
  5. ## regularly, especially when using multihop-VPN's.
  6. ## It can be freely copied, distributed, modified.
  7.  
  8. ## Ce script shell simple est un "DNS LOOP CHANGER" pour changer le DNS du sytème d'exploitation Linux
  9. ## régulièrement, notamment lors de l'usage de VPN's multihop.
  10. ## Il peut être librement copié, diffusé, modifié.
  11.  
  12. ## Questo semplice script di shell è un "DNS LOOP CHANGER" per cambiare regolarmente il DNS del sistema operativo Linux,
  13. ## specialmente quando si usano VPN multihop.
  14. ## Può essere liberamente copiato, distribuito, modificato.
  15.  
  16.  
  17.    systemctl stop resolvconf.service
  18.       echo " !! Stop resolvconf.service !!";
  19.    systemctl start resolvconf.service
  20.       echo " ...";
  21.       echo " ...";
  22.       echo " ...";
  23.       echo " !! Start resolvconf.service !!"
  24.  
  25.  
  26.  
  27.   let incre=$((1));
  28.   let loopnumber=$((0));
  29.   let QW=$((0))
  30.   let loopnumber=$((loopnumber+incre));
  31.  
  32.  while [[ 1 ]]; do
  33.  
  34.   let QW=$((QW+1));
  35.  
  36.       echo "  ...";
  37.       echo "  ...";
  38.       echo "  ...";
  39.  
  40.       echo "  Loop n° "$loopnumber;
  41.       echo "  ...";
  42.       echo "  ...";
  43.       echo "  ...";
  44.       echo "  >>> DNS BASE $QW <<<";
  45.  
  46.    rm /etc/resolv.conf
  47.  
  48.    cp /etc/resolvconf/resolv.conf.d/base$QW /etc/resolvconf/resolv.conf.d/base
  49.    cp /etc/resolvconf/resolv.conf.d/base$QW /etc/resolv.conf
  50.  
  51.    systemctl restart resolvconf.service
  52.    systemctl status dnsloopchanger.service
  53.  
  54.   sleep 975
  55.  
  56.       echo " ...";
  57.       echo " - DNS BASE $QW ENDED -";
  58.       echo " ...";
  59.       echo " - NOW NEXT DNS BASE -";
  60.       echo " ...";
  61.  
  62.   if [[ $QW == 11 ]]; then
  63.  
  64.      let QW=$((0));
  65.  
  66.      let loopnumber=$((loopnumber+incre));
  67.  
  68.   fi
  69.  
  70.  
  71.  done
  72.  
  73. exit 0;
RAW Paste Data