Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- USER=$(whoami)
- if [ ! $USER = 'root' ]; then
- echo Sorry you\'re not the boss!
- exit 1;
- fi
- scheme="$@"
- if [ -z $scheme ]; then
- echo Please provide a network scheme!
- exit 1;
- fi
- if [ -f /etc/network/interfaces.${scheme} ]; then
- cp -f /etc/network/interfaces.${scheme} /etc/network/interfaces
- systemctl restart networking.service && echo Network scheme is $scheme
- else
- echo Scheme "$scheme" does not exist!
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement