Advertisement
zefie

simple distcc tester

Apr 8th, 2019
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.72 KB | None | 0 0
  1. #!/bin/bash
  2. export DISTCC_JOBS=$(distcc -j)
  3. echo " * Testing distcc..."
  4.  
  5. # test distcc .. distcc won't distribute stdin so make temp file
  6. Z_HELLO_C='I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIHByaW50ZigiSGVsbG8gZGlzdGNjIVxuIik7CiAgICByZXR1cm4gMDsKfQo='
  7.  
  8. DISTCC_VERBOSE=1
  9. Z_TMP=$(mktemp --suffix='.c')
  10. echo "${Z_HELLO_C}" | base64 -d > "${Z_TMP}"
  11. Z_TEST=$(distcc "$(realpath "$(which gcc)")" -o /dev/null -c "${Z_TMP}" 2>&1)
  12. rm "${Z_TMP}"
  13. Z_RES=$(echo "${Z_TEST}" | grep -c 'failed to distribute')
  14. unset DISTCC_VERBOSE
  15.  
  16. if [ ${Z_RES} -gt 0 ]; then
  17.        echo " ! Your distcc host is not working! Please fix or try again with distcc mode"
  18.        echo "${Z_TEST}"
  19.        exit 1;
  20. else
  21.        echo " * Okay! :)"
  22. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement