-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUbuntu_cloudinstall.sh
More file actions
47 lines (35 loc) · 987 Bytes
/
Ubuntu_cloudinstall.sh
File metadata and controls
47 lines (35 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
apt install -y git
git clone https://gitee.com/jayson0201/cloudinstall.git
mv cloudinstall/* ./
tar -xvf cloudreve_3.5.3_linux_amd64.tar.gz
rm -rf cloudreve_3.5.3_linux_amd64.tar.gz
rm -rf cloudinstall/
rm -rf cloudinstall/
rm -rf LICENSE README.*
./cloudreve >>passwd.txt &
sleep 3
pid=`ps -ef | grep cloudreve | grep -v grep | awk '{print $2}'`;kill $pid
cat passwd.txt
cloudpath=$(cd `dirname $0`; pwd)
cat >/lib/systemd/system/cloudreve.service <<EOF
[Unit]
Description=Cloudreve
Documentation=https://docs.cloudreve.org
After=network.target
Wants=network.target
[Service]
WorkingDirectory=$cloudpath
ExecStart=$cloudpath/cloudreve
Restart=on-abnormal
RestartSec=5s
KillMode=mixed
StandardOutput=null
StandardError=syslog
[Install]
WantedBy=multi-user.target
# 启动服务
systemctl start cloudreve
# 设置开机启动
systemctl enable cloudreve
echo "安装完成,请用上面的账号密码登录,如若不行,请放行5212端口"
rm -rf centos_cloudinstall.sh