Trigger service on file change
Create service file
nano /etc/systemd/system/lsws-restart.service
Content:
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart lsws.service
[Install]
WantedBy=multi-user.target
Create "path" service
nano /etc/systemd/system/lsws-restart.path
Content:
[Path]
PathChanged=/usr/local/lsws/vhosts/xxx/http/current/public/.htaccess
[Install]
WantedBy=multi-user.target
Enable "path" service
systemctl enable lsws-restart.path
systemctl start lsws-restart.path
And let the magic begin