Browse Source

fixed file name

master
Brandon Nolet 1 year ago
parent
commit
85620e9fd2
1 changed files with 31 additions and 0 deletions
  1. 31
    0
      nmcli-basic.sh

+ 31
- 0
nmcli-basic.sh View File

@@ -0,0 +1,31 @@
#!/bin/bash

#Version 0.1
#Author: Brandon Nolet
#Contact: nolet.brandon@gmail.com

nmcli con show

echo
read -p "Which interface to configure? " ID
echo
read -p "What's the ip? " IP
echo
read -p "And the prefix length? " PL
echo
read -p "What's the gateway IP? " GIP
echo
read -p "Lastly the DNS addresses? " DNS
echo
echo "Configuring..."
nmcli con mod $ID ipv4.addresses $IP/$PL
nmcli con mod $ID ipv4.gateway $GIP
nmcli con mod $ID ipv4.dns "$DNS"
nmcli con mod $ID ipv4.method manual
echo "Restarting interface..."
nmcli con down $ID > /dev/null
nmcli con up $ID > /dev/null
echo "Done!"


exit

Loading…
Cancel
Save