Re: Network restart


John Lorenc
 

Hi Klaus

Linux is case sensitive.

Change All to ALL.

John va3wm


On Apr 2, 2020, at 3:32 PM, Klaus Rung via groups.io <k_rung@...> wrote:


This is what I have in custom_decode

if [ "$1" = "22" ] ; then sudo /service networking restart ; exit 1 ; fi

This is what I have in sudoers but when I run it it wants the passwd

repeater@stn2450:~/$ decode 22
[sudo] password for repeater:




# User privilege specification
root    ALL=(ALL:ALL) ALL
# ADD THIS LINE TO ALLOW repeater USER TO REBOOT
repeater     ALL=NOPASSWD:/sbin/reboot
repeater     All=NOPASSWD:/usr/sbin/service network restart


Where have I gone wrong?



On Thursday, April 2, 2020, 2:02:59 p.m. EDT, k9dc <dave@...> wrote:



As long as /usr/sbin/service is allowed by your /etc/sudoers file it should work fine.

'service networking restart' is the command to use (not service network restart).  You could also include 'service openvpn restart’ if you are using IRLP VPN.

I usually setup sudoers to allow ALL commands, rather than individually listed commands. Some folks consider that to be a security risk, which I suppose it is.  But for me, convenience outweighs security. It’s not like I have a large group of users logging in to my nodes and breaking things.

-k9dc


> On Apr 2, 2020, at 13:45, Klaus Rung via groups.io <k_rung=yahoo.com@groups.io> wrote:
>
> I have this script working to restart the node and it is working very well.
>
> # Reboot node via DTMF Code
>
> if [ "$1" = "C22" ] ; then sudo /sbin/reboot ; exit 1 ; fi
>
>
> My next question is how can I use the above to do a service network restart to just restart the network only?
>
> Any ideas would be very welcome,
>
> thanks in advance.
>
> Klaus
> ve3kr






Join IRLP@irlp.groups.io to automatically receive all group messages.