Linux comand: visudo
visudo
To give a user sudo permits
sudo visudo
add line:
pi ALL=(ALL) NOPASSWD: ALL
or
root ALL=(ALL:ALL) ALL
To allow some unprivileged user to run some commands with sudo:
joe ALL=(ALL) NOPASSWD: /full/path/to/command
or with some arguments:
joe ALL=(ALL) NOPASSWD: /full/path/to/command ARG1 ARG2
fixroute script
match=$(route -n | awk '{print $1 " " $2}' | grep '0.0.0.0 172.27.0.1')
if [ ! -z "$match" ]; then
sudo route del -net 0.0.0.0 netmask 0.0.0.0 gw 172.27.0.1 enp0s25 >> /tmp/fixroute.log
echo "\033[1;32m Removed route from routing table \033[0;00m"
sudo route -n
else
echo "\033[1;31m Route not found: -net 0.0.0.0 netmask 0.0.0.0 gw 172.27.0.1 enp0s25 \033[0;00m"
sudo route -n
fi