PHP 8.3.31
Preview: wswatch.sh Size: 843 B
/usr/local/lsws/bin/wswatch.sh

#!/bin/sh

BASE_DIR=`dirname "$0"`
cd "$BASE_DIR"
BASE_DIR=`pwd`


while [ "1" -eq "1" ]; do

ERR=1
if [ -f /tmp/lshttpd/lshttpd.pid ]; then
    kill -0 `cat /tmp/lshttpd/lshttpd.pid` 2>/dev/null
    ERR=$?
fi

if [ $ERR -ne 0 ]; then
    sleep 10
    if [ -f /tmp/lshttpd/lshttpd.pid ]; then
        kill -0 `cat /tmp/lshttpd/lshttpd.pid` 2>/dev/null
        ERR=$?
    fi
fi

if [ $ERR -ne 0 ]; then
    D=`date`
    echo "$D: LSWS stopped, start LSWS." >> $BASE_DIR/../logs/wswatch.log
    if [ -f /usr/sbin/service ]; then
        /usr/sbin/service lsws start >> $BASE_DIR/../logs/wswatch.log 2>&1
    else 
        if [ -f /sbin/service ]; then
            /sbin/service lsws start >> $BASE_DIR/../logs/wswatch.log 2>&1
        else
            service lsws start >> $BASE_DIR/../logs/wswatch.log 2>&1
        fi
    fi
fi
sleep 2

done

Directory Contents

Dirs: 0 × Files: 18

Name Size Perms Modified Actions
262.84 KB lr-xr-xr-x 2026-05-16 06:20:08
Edit Download
7.34 MB lr-xr-xr-x 2026-05-16 06:20:08
Edit Download
262.84 KB lr-xr-xr-x 2026-05-16 06:20:08
Edit Download
241.02 KB lr-xr-xr-x 2025-05-12 13:06:40
Edit Download
241.05 KB lr-xr-xr-x 2025-07-30 06:20:06
Edit Download
241.16 KB lr-xr-xr-x 2026-02-26 07:20:07
Edit Download
262.84 KB lr-xr-xr-x 2026-05-16 06:20:08
Edit Download
7.34 MB lr-xr-xr-x 2026-05-16 06:20:08
Edit Download
7.32 MB lr-xr-xr-x 2025-05-12 13:06:40
Edit Download
7.33 MB lr-xr-xr-x 2025-07-30 06:20:06
Edit Download
7.34 MB lr-xr-xr-x 2026-02-26 07:20:07
Edit Download
7.34 MB lr-xr-xr-x 2026-05-16 06:20:08
Edit Download
6.33 KB lr-xr-xr-x 2026-05-16 06:20:08
Edit Download
6.33 KB lr-xr-xr-x 2025-05-12 13:06:40
Edit Download
6.33 KB lr-xr-xr-x 2025-07-30 06:20:06
Edit Download
6.33 KB lr-xr-xr-x 2026-02-26 07:20:07
Edit Download
6.33 KB lr-xr-xr-x 2026-05-16 06:20:08
Edit Download
843 B lr-xr-xr-x 2026-05-16 06:20:08
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).