Advertisement
SyP-

debian_config.sh

Sep 7th, 2021
1,153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/bin/bash
  2. if [ ! $UID -eq 0 ]; then
  3. echo "Ejeute como root"
  4. exit
  5. fi
  6.  
  7. read -p "Dirección IP 192.168.1." IP
  8.  
  9. echo "# This file describes the network interfaces available on your system
  10. # and how to activate them. For more information, see interfaces(5).
  11.  
  12. source /etc/network/interfaces.d/*
  13.  
  14. # The loopback network interface
  15. auto lo
  16. iface lo inet loopback
  17.  
  18. # The primary network interface
  19. allow-hotplug enp0s3
  20. iface enp0s3 inet static
  21.     address 192.168.1.$IP
  22.     netmask 255.255.255.0
  23.    gateway 192.168.1.1" > /etc/network/interfaces
  24.  
  25. echo ""
  26. read -p "Hostname " HNAME
  27.  
  28. hostnamectl set-hostname $HNAME
  29.  
  30. reboot
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement