update start.sh
This commit is contained in:
parent
71025e85de
commit
dafd5e7cf8
|
|
@ -13,7 +13,16 @@ echo "下载卸载脚本..."
|
||||||
wget -q --show-progress https://git.nps.crabapples.cn/crabapples/learn-spider/raw/branch/main/sh/uninstall.sh && chmod +x uninstall.sh
|
wget -q --show-progress https://git.nps.crabapples.cn/crabapples/learn-spider/raw/branch/main/sh/uninstall.sh && chmod +x uninstall.sh
|
||||||
echo "下载完成"
|
echo "下载完成"
|
||||||
echo "开始安装..."
|
echo "开始安装..."
|
||||||
./install.sh
|
|
||||||
|
USER_COUNT=10
|
||||||
|
# 公共的工作目录
|
||||||
|
PUBLIC_DIR="/shared"
|
||||||
|
# git仓库加速地址
|
||||||
|
GIT_NO_VNC="https://git.nps.crabapples.cn/crabapples/noVNC.git"
|
||||||
|
GIT_WEBSOCKIFY="https://git.nps.crabapples.cn/crabapples/websockify.git"
|
||||||
|
GIT_PY_SPIDER="https://git.nps.crabapples.cn/crabapples/learn-spider.git"
|
||||||
|
|
||||||
|
./install.sh $USER_COUNT $PUBLIC_DIR $GIT_NO_VNC $GIT_WEBSOCKIFY $GIT_PY_SPIDER
|
||||||
echo "安装完成"
|
echo "安装完成"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,13 @@
|
||||||
|
|
||||||
# ==================== 配置变量 ====================
|
# ==================== 配置变量 ====================
|
||||||
# 需要创建的用户数量
|
# 需要创建的用户数量
|
||||||
USER_COUNT=10
|
USER_COUNT=${1:-10}
|
||||||
# 公共的工作目录
|
# 公共的工作目录
|
||||||
PUBLIC_DIR="/shared"
|
PUBLIC_DIR="${2:-/shared}"
|
||||||
# git仓库原地址
|
# git仓库地址
|
||||||
GIT_NO_VNC_BAK="https://github.com/novnc/noVNC.git"
|
GIT_NO_VNC="${3:-https://github.com/novnc/noVNC.git}"
|
||||||
GIT_WEBSOCKIFY_BAK="https://github.com/novnc/websockify.git"
|
GIT_WEBSOCKIFY="${4:-https://github.com/novnc/websockify.git}"
|
||||||
# git仓库加速地址
|
GIT_PY_SPIDER="${5:-https://git.nps.crabapples.cn/crabapples/learn-spider.git}"
|
||||||
GIT_NO_VNC="https://git.nps.crabapples.cn/crabapples/noVNC.git"
|
|
||||||
GIT_WEBSOCKIFY="https://git.nps.crabapples.cn/crabapples/websockify.git"
|
|
||||||
GIT_PY_SPIDER="https://git.nps.crabapples.cn/crabapples/learn-spider.git"
|
|
||||||
|
|
||||||
# ==================== 函数定义 ====================
|
# ==================== 函数定义 ====================
|
||||||
|
|
||||||
# 1. 预安装软件
|
# 1. 预安装软件
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PUBLIC_DIR="/shared"
|
|
||||||
INDEX=$1
|
INDEX=$1
|
||||||
|
PUBLIC_DIR="${2:-/shared}"
|
||||||
username="user$INDEX"
|
username="user$INDEX"
|
||||||
export DISPLAY=:$INDEX
|
export DISPLAY=:$INDEX
|
||||||
echo "当前显示桌面:$DISPLAY"
|
echo "当前显示桌面:$DISPLAY"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
USER_COUNT=100
|
USER_COUNT="${1:-10}"
|
||||||
PUBLIC_DIR="/shared"
|
PUBLIC_DIR="${2:-/shared}"
|
||||||
SECOUND=5
|
SECOND="${3:-5}"
|
||||||
|
|
||||||
batch_kill_process(){
|
batch_kill_process(){
|
||||||
echo "正在结束进程"
|
echo "正在结束进程"
|
||||||
|
|
@ -27,9 +27,9 @@ batch_delete_user(){
|
||||||
echo "批量删除完成!"
|
echo "批量删除完成!"
|
||||||
}
|
}
|
||||||
|
|
||||||
for i in $(seq 1 $SECOUND); do
|
for i in $(seq 1 $SECOND); do
|
||||||
clear
|
clear
|
||||||
echo "$(($SECOUND-$i))S后开始数据清理...."
|
echo "$(($SECOND-$i))S后开始数据清理...."
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PUBLIC_DIR="/shared"
|
PUBLIC_DIR="${1:-/shared}"
|
||||||
GIT_PY_SPIDER="https://git.nps.crabapples.cn/crabapples/learn-spider.git"
|
GIT_PY_SPIDER="${2:-https://git.nps.crabapples.cn/crabapples/learn-spider.git}"
|
||||||
|
echo "开始更新爬虫"
|
||||||
cd $PUBLIC_DIR
|
cd $PUBLIC_DIR
|
||||||
if [ -d "learn-spider" ]; then
|
if [ -d "learn-spider" ]; then
|
||||||
cd learn-spider
|
cd learn-spider
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue