sudo-parental-control/client/sudo
2024-04-24 22:06:16 +02:00

15 lines
340 B
Bash
Executable file

#!/usr/bin/env bash
url="https://sudo-parental-control.jacekpoz.pl"
json=$(echo '{"username":"'$USER'","command":"'$@'"}')
r=$(curl -s -X POST $url --data "$json")
if [ "$r" = "ok" ]; then
echo "Parental control approves the request"
sudo $@
else
echo "Parental control prohibits the usage of sudo"
echo "Reason: $r"
fi