Skip to content

Commit 264dcea

Browse files
authored
Create InstallFVTT.sh
0 parents  commit 264dcea

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

InstallFVTT.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
# sh initialization
3+
4+
version="CentOS Linux release 7."
5+
release=$(cat /etc/redhat-release)
6+
result=$(echo $release | grep "${version}")
7+
cd $home
8+
9+
if [[ "$result" != "" ]]
10+
then
11+
echo "CentOS 7.X 确认,等待载入脚本."
12+
# stop 停止防火墙
13+
systemctl stop firewalld
14+
# 键入下载URL
15+
read -p "请输入Node.js文件包安装下载地址: " fvtturl
16+
# 安装基本环境
17+
cd $home
18+
yum install -y openssl-devel unzip zip
19+
curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -
20+
yum install -y nodejs
21+
# 创建文件夹
22+
mkdir foundryvtt
23+
mkdir foundrydata
24+
cd foundryvtt
25+
#下载文件包
26+
wget -O foundryvtt.zip "$fvtturl"
27+
#wget -O foundryvtt.zip https://www.peatsuki.com/sh/foundryvtt.zip --no-check-certificate
28+
unzip foundryvtt.zip
29+
cd $home
30+
#后台模式选择
31+
echo "请选择后台安装模式 [P] PM2 [其他任意键]nohup"
32+
read -n 1 -p "请输入: " background
33+
if [[ "$background" = "P" ]]
34+
then
35+
#以PM2运行fvtt
36+
npm install -g pm2
37+
pm2 start foundryvtt/resources/app/main.js
38+
else
39+
#以nohup运行fvtt并下载重启脚本
40+
wget https://www.peatsuki.com/sh/startfvtt.sh --no-check-certificate
41+
nohup node foundryvtt/resources/app/main.js --dataPath=$HOME/foundrydata &
42+
fi
43+
44+
else
45+
echo "系统类型与版本校验错误,脚本退出."
46+
exit 1
47+
fi

0 commit comments

Comments
 (0)