Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- output_file="${USER}.json"
- # tamaño del directorio de usuario
- home_size=$(du -sh "$HOME" | cut -f 1)
- api_server="192.168.88.7:8000"
- # Script python embebido
- #
- python3 -c "import json; print(json.dumps({
- 'user': '$USER',
- 'home': '$HOME',
- 'home_size': '$home_size'
- }))" > "$output_file"
- curl -X POST http://${api_server}/report \
- -H "Content-Type: application/json" \
- -d @"$output_file"
Advertisement