Write shell script that can only be run by a sudo user in Ubuntu -


i'm writing shell script supposed run users in sudo user list, what's appropriate way of doing this?

what i'm thinking in shell script, try create dummy file in system dir such /var/run/ , remove it, users not in sudo list receive permission error, believe there gotta more appropriate way of doing this, helping

you can check values of $uid , $euid in script. 0 being equivalent root. or, if not bash, can use id -u.


Comments

Popular posts from this blog

List<T>().Add problem C# -

Javascript natural sort array/object and maintain index association -