Browse Source

Merge branch 'master' of gitlab.com:Brandonnolet/nmcli-basic

I don't know
master
Brandon Nolet 1 year ago
parent
commit
35c712bb8b
1 changed files with 0 additions and 31 deletions
  1. 0
    31
      nmcli-based.sh

+ 0
- 31
nmcli-based.sh View File

@@ -1,31 +0,0 @@
#!/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