On 10/3/23 14:14, old sixpack13 wrote:
I have the following problem:
I'm logged in as user joe (he is not in sudo group) and want to etherwake a remote
box, called nuc, via an one-liner in an script.
now, on an command line, I usually do
1. su - ron (ron is in sudo group)
2. and then sudo ether-wake -i enp3s0 <mac-address> && ping nuc
etherwake needs root access
I want to combine 1. and 2. and run the combined command out of an script, but I'm
failling.
I don't want to have user joe in sudo group
Idea's ?
su -c "sudo ether-wake -i enp3s0 <mac-address> && ping nuc" - ron