site-enabled 359 B

12345678910111213141516
  1. #!/bin/bash
  2. readonly ARGS="$@";
  3. main(){
  4. local code=0;
  5. local site="$(echo $1 | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g')";shift
  6. local output="$(apachectl -S 2> /dev/null)";
  7. if [[ "$(echo $output | grep "$site")" != "" ]];then
  8. echo "Enabled";
  9. else
  10. echo "Not Enabled";
  11. code=1;
  12. fi;
  13. unset -f main;
  14. exit $code;
  15. }
  16. main $ARGS;