Merge pull request 'master' (#1) from krizej/sudo-parental-control:master into master

Reviewed-on: jacekpoz/sudo-parental-control#1
This commit is contained in:
jacekpoz 2024-04-24 22:12:11 +02:00
commit b4ff5d1df7
6 changed files with 94 additions and 0 deletions

79
README.md Normal file
View file

@ -0,0 +1,79 @@
# sudo parental control
## sudo parental control
### sudo parental control
#### sudo parental control
##### sudo parental control
###### sudo parental control
##### sudo parental control
#### sudo parental control
### sudo parental control
## sudo parental control
# sudo parental control
# usage
## usage
### usage
#### usage
##### usage
###### usage
##### usage
#### usage
### usage
## usage
# usage
# server
## server
### server
#### server
##### server
###### server
##### server
#### server
### server
## server
# server
i don't know
# client
## client
### client
#### client
##### client
###### client
##### client
#### client
### client
## client
# client
```
sudo <command>
```
# thanks
## thanks
### thanks
#### thanks
##### thanks
###### thanks
##### thanks
#### thanks
### thanks
## thanks
# thanks
thanks
# special thanks
## special thanks
### special thanks
#### special thanks
##### special thanks
###### special thanks
##### special thanks
#### special thanks
### special thanks
## special thanks
# special thanks
thanks

15
client/sudo Executable file
View 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

View file