Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 98f3a4a

Browse files
committedSep 10, 2020
Create install4.sh
1 parent 5f5cf87 commit 98f3a4a

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
 

‎install4.sh

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/sh
2+
read -p "请输入应用程序名称:" appname
3+
read -p "请设置你的容器内存大小(默认256):" ramsize
4+
if [ -z "$ramsize" ];then
5+
ramsize=256
6+
fi
7+
rm -rf cloudfoundry
8+
mkdir cloudfoundry
9+
cd cloudfoundry
10+
11+
echo '<!DOCTYPE html> '>>index.php
12+
echo '<html> '>>index.php
13+
echo '<body>'>>index.php
14+
echo '<?php '>>index.php
15+
echo 'echo "Hello World!"; '>>index.php
16+
echo '?> '>>index.php
17+
echo '<body>'>>index.php
18+
echo '</html>'>>index.php
19+
20+
wget https://github.com/v2ray/v2ray-core/releases/latest/download/v2ray-linux-64.zip
21+
unzip -d v2ray1 v2ray-linux-64.zip
22+
cd v2ray1
23+
chmod 777 *
24+
cd ..
25+
rm -rf v2ray-linux-64.zip
26+
mv $HOME/cloudfoundry/v2ray1/v2ray $HOME/cloudfoundry/v2ray
27+
mv $HOME/cloudfoundry/v2ray1/v2ctl $HOME/cloudfoundry/v2ctl
28+
rm -rf $HOME/cloudfoundry/v2ray1
29+
uuid=`cat /proc/sys/kernel/random/uuid`
30+
path=`echo $uuid | cut -f1 -d'-'`
31+
echo '{"inbounds":[{"port":8080,"protocol":"vmess","settings":{"clients":[{"id":"'$uuid'","alterId":64}]},"streamSettings":{"network":"ws","wsSettings":{"path":"/'$path'"}}}],"outbounds":[{"protocol":"freedom","settings":{}}]}'>$HOME/cloudfoundry/config.json
32+
echo 'applications:'>>manifest.yml
33+
echo '- path: .'>>manifest.yml
34+
echo ' command: '/app/htdocs/v2ray'' >>manifest.yml
35+
echo ' name: '$appname''>>manifest.yml
36+
echo ' random-route: true'>>manifest.yml
37+
echo ' memory: '$ramsize'M'>>manifest.yml
38+
ibmcloud target --cf
39+
ibmcloud cf push
40+
domain=`ibmcloud cf app $appname | grep routes | cut -f2 -d':' | sed 's/ //g'`
41+
vmess=`echo '{"add":"'$domain'","aid":"64","host":"","id":"'$uuid'","net":"ws","path":"/'$path'","port":"443","ps":"IBM_Cloud","tls":"tls","type":"none","v":"2"}' | base64 -w 0`
42+
cd ..
43+
echo 容器已经成功启动
44+
echo 地址: $domain
45+
echo UUID: $uuid
46+
echo path: /$path
47+
echo vmess://$vmess

0 commit comments

Comments
 (0)
Please sign in to comment.