test01ies

veyon lliurex linux add pcs

May 20th, 2024
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.78 KB | Source Code | 0 0
  1. # IPs setup
  2. VEYON_CLI=veyon-cli
  3. echo "Escribe aula"
  4. read AULA
  5. sudo $VEYON_CLI networkobjects clear  2>/dev/null
  6. sudo $VEYON_CLI networkobjects add location $AULA  2>/dev/null
  7.  
  8. echo "Introduce la primera IP: "
  9. read IP
  10. IP_START_BYTES=(${IP//./ })
  11. echo "Introduce la última IP:"
  12. read IP
  13. IP_END_BYTES=(${IP//./ })
  14.  
  15. IP_START_NUM=$(( ${IP_START_BYTES[0]} << 24 | ${IP_START_BYTES[1]} << 16 | ${IP_START_BYTES[2]} << 8 | ${IP_START_BYTES[3]} ))
  16. IP_END_NUM=$(( ${IP_END_BYTES[0]} << 24 | ${IP_END_BYTES[1]} << 16 | ${IP_END_BYTES[2]} << 8 | ${IP_END_BYTES[3]} ))
  17.  
  18. for (( i=$IP_START_NUM; i<=$IP_END_NUM; i++ )) do
  19.   IP="$((($i >> 24) & 0xff )).$((($i >> 16) & 0xff )).$((($i >> 8) & 0xff )).$(($i & 0xff ))"
  20.   sudo $VEYON_CLI networkobjects add computer $IP $IP "" $AULA  2>/dev/null
  21. done
Add Comment
Please, Sign In to add comment