I am creating a self-control tool for administrators. The script when run by an administrator, would voluntarily drop admin privileges. The administrator can regain admin privileges by running the script again but faces an intentional delay (of say 20 min). What would be a good way to do this?My solutionLet's say the administrator is called my-admin. My current solution is the following:Add a file in /etc/sudoers.d that allows my-admin to run a script called /usr/local/bin/delayed-admin as root.The script /usr/local/bin/delayed-admin does the following: If my-admin is a part of the admin group, it removes it from the group. And if my-admin is not in the admin group then it sleeps for 20min and then adds it to the admin group. This seems to work, but I don't like the idea of messing with the sudoer file every time. 
Script to temporarily drop admin privileges
security;sudo;users;root