sergio_educacionit

fastapi user_space.sh

Dec 5th, 2025
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. output_file="${USER}.json"
  4.  
  5. # tamaƱo del directorio de usuario
  6.  
  7. home_size=$(du -sh $HOME | cut -d ' ' -f 1 )
  8.  
  9. api_server="192.168.88.6:8000"
  10.  
  11. echo "{
  12. \"user\": \"$USER\",
  13. \"home\": \"$HOME\",
  14. \"home_size\": \"$home_size\"
  15. }" > "$output_file"
  16.  
  17.  
  18. curl -X POST http://${api_server}/report \
  19. -H "Content-Type: application/json" \
  20. -d @"$output_file"
Advertisement
Add Comment
Please, Sign In to add comment