X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/08634fba9fd0e28a484f51a0f969bdf270b5f5e5..261ddcef45ede2f9440342a5b3dd474e26df1679:/INSTALL/VentoyWeb.sh diff --git a/INSTALL/VentoyWeb.sh b/INSTALL/VentoyWeb.sh index 9baf33b..f06ae06 100644 --- a/INSTALL/VentoyWeb.sh +++ b/INSTALL/VentoyWeb.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash print_usage() { echo 'Usage: VentoyWeb.sh [ OPTION ]' @@ -23,10 +23,12 @@ fi OLDDIR=$(pwd) -if uname -a | egrep -q 'aarch64|arm64'; then +if uname -m | egrep -q 'aarch64|arm64'; then TOOLDIR=aarch64 -elif uname -a | egrep -q 'x86_64|amd64'; then +elif uname -m | egrep -q 'x86_64|amd64'; then TOOLDIR=x86_64 +elif uname -m | egrep -q 'mips64'; then + TOOLDIR=mips64el else TOOLDIR=i386 fi @@ -43,6 +45,7 @@ if [ ! -f ./boot/boot.img ]; then if [ -d ./grub ]; then echo "Don't run VentoyWeb.sh here, please download the released install package, and run the script in it." else + echo "Current directory is $PWD" echo "Please run under the correct directory!" fi exit 1 @@ -97,12 +100,17 @@ if [ -f ./tool/$TOOLDIR/V2DServer.xz ]; then chmod +x ./tool/$TOOLDIR/V2DServer fi + +V2DServer "$HOST" "$PORT" & +wID=$! +sleep 1 + vtVer=$(cat ventoy/version) echo "" echo "===============================================================" if [ "$LANG" = "zh_CN.UTF-8" ]; then - echo " Ventoy Server $vtVer ÒѾ­Æô¶¯ ..." - echo " Çë´ò¿ªä¯ÀÀÆ÷£¬·ÃÎÊ http://${HOST}:${PORT}" + echo " Ventoy Server $vtVer 已经启动 ..." + echo " 请打开浏览器,访问 http://${HOST}:${PORT}" else echo " Ventoy Server $vtVer is running ..." echo " Please open your browser and visit http://${HOST}:${PORT}" @@ -112,7 +120,7 @@ echo "" echo "################## Press Ctrl + C to exit #####################" echo "" -V2DServer "$HOST" "$PORT" +wait $wID if [ -n "$OLDDIR" ]; then CURDIR=$(pwd)