Advertisement
drkskwlkr

OpenLiteSpeedRestartHTACC

Nov 18th, 2021 (edited)
1,301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Look for a .htaccess file that has been modified less than 10 minutes ago
  4. # (feel free to adjust that number to your neeeds) and if it finds something
  5. # it then proceeds to restart OpenLiteSpeed webserver to make it load the
  6. # contents of that .htaccess file anew
  7.  
  8. if ! find /home/*/*/public_html/ -newermt '10 minutes ago' \
  9.      -type f -name '.htaccess' -exec false {} +; \
  10. then \
  11.      echo "Restarting Litespeed server..." ; systemctl restart lsws ; \
  12. else \
  13.      echo "No recent changes to .htaccess file(s) detected. No restart necessary." ; \
  14. fi
  15.  
  16. # Script created by Ivan Arnaudov
  17. # https://m.me/ivan.webstage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement