networkIoDetect.sh 387 B

1234567891011
  1. #!/bin/sh
  2. isSudo=""
  3. if [[ $(whoami) != "root" ]] ; then isSudo="sudo" ; fi
  4. version=$("python" --version 2>&1 | awk '{print $2 }')
  5. if [[ "$version" > "3.0" && "$version" < "4.0" ]]; then
  6. echo $($isSudo "python" networkIoDetect3.py $* )
  7. elif [[ "$version" > "2.6" && "$version" < "3.0" ]]; then
  8. echo $($isSudo "python" networkIoDetect2.py $* )
  9. else
  10. echo "shellscript error"
  11. fi