mirror of
https://github.com/byReqz/netset.git
synced 2024-11-22 12:51:15 +00:00
add selector
This commit is contained in:
parent
3554d2b93d
commit
be403af671
14
netset.sh
Normal file → Executable file
14
netset.sh
Normal file → Executable file
@ -1,7 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# license: gpl-3
|
# license: gpl-3
|
||||||
|
echo "which networkmanager do you want to use?"
|
||||||
if [[ -z $(sudo systemctl status systemd-networkd | grep -e "dead") ]];then
|
echo "please enter the name or number of your choice"
|
||||||
|
echo "1. systemd-resolved"
|
||||||
|
read $c1
|
||||||
|
if [[ "$c1" == "1" ]] || [[ "$c1" == "1." ]] || [[ "$c1" == "systemd-resolved" ]];then
|
||||||
|
if [[ -z $(sudo systemctl status systemd-networkd | grep -e "dead") ]];then
|
||||||
if [[ $(ls -l /etc/systemd/network | wc -l) != 0 ]];then
|
if [[ $(ls -l /etc/systemd/network | wc -l) != 0 ]];then
|
||||||
echo "warning, there already are configs present"
|
echo "warning, there already are configs present"
|
||||||
echo "do you want to continue? (Y/n)"
|
echo "do you want to continue? (Y/n)"
|
||||||
@ -114,7 +118,11 @@ if [[ -z $(sudo systemctl status systemd-networkd | grep -e "dead") ]];then
|
|||||||
echo "======================"
|
echo "======================"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "systemd-networkd is not running"
|
echo "systemd-networkd is not running"
|
||||||
exit
|
exit
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "selected manager not supported"
|
||||||
|
exit
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue
Block a user