find-disabled-sites 405 B

123456789101112131415161718
  1. #!/bin/bash
  2. main(){
  3. pushd /var/www/ > /dev/null;
  4. ls | while read site;do
  5. site="$(echo $site | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g')";
  6. if [ -d $site ];then
  7. site-enabled "$site" > /dev/null;
  8. if [ $? -ne 0 ];then
  9. echo "$site is not enabled";
  10. fi;
  11. else
  12. echo "$site is not a directory";
  13. fi;
  14. done;
  15. popd > /dev/null;
  16. unset -f main;
  17. }
  18. main;