linux 下快速启动 webd 映射本地目录为网盘使用
快速执行:
curl -s https://files-cdn.cnblogs.com/files/nihaorz/startup_webd.sh | bash
可以跟两个参数,分别表示网盘根目录和 http 端口号
脚本如下:
#!/bin/bash
WEBD_ROOT="$1"
WEBD_PORT="$2"
WEBD_VERSION=$(curl -s https://cnt2.cf/webd/changelog.txt | head -n 1)
WEBD_VERSION=${WEBD_VERSION//\//}
WEBD_TYPE=$(uname -m)
if [ "$WEBD_TYPE" == "x86_64" ]
then
WEBD_TYPE="x86_64-pc"
fi
curl -sO https://cnt2.cf/webd/$WEBD_VERSION/webd-$WEBD_VERSION-$WEBD_TYPE-linux-gnu.tar.gz
tar -zxf webd-$WEBD_VERSION-$WEBD_TYPE-linux-gnu.tar.gz
rm webd-$WEBD_VERSION-$WEBD_TYPE-linux-gnu.tar.gz -rf
if [ "$WEBD_ROOT" == "" ]
then
WEBD_ROOT=$PWD
fi
if [ "$WEBD_PORT" == "" ]
then
WEBD_PORT=9212
fi
webd/webd -w $WEBD_ROOT -l $WEBD_PORT
rm webd -rf

浙公网安备 33010602011771号