forked from poz/sudo-parental-control
feat: add client-side script
This commit is contained in:
parent
1685eb1d54
commit
bf45fc550f
1 changed files with 15 additions and 0 deletions
15
client/sudo
Executable file
15
client/sudo
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/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
|
||||||
|
|
Loading…
Reference in a new issue