#!/bin/bash
function v2boot(){
	echo "v2 Boot install";
	#check wether vps suppot ppp and tun
	cd /opt/xray-webui/
	cp xray-webui.service /etc/systemd/system/
	systemctl enable xray-webui.service
	systemctl start xray-webui.service
	systemctl status xray-webui.service
	echo "v2 Boot Ok"
}



function installV2(){
	echo "xray-webui";
	#check wether vps suppot ppp and tun
	apt update
	apt upgrade 
	apt install -y m2crypto git screen zip vim curl gzip
    cd /opt
	mkdir xray-webui
	cd xray-webui
	wget https://www.xuanlove.download/Xray/Xray-webui/xray-webui-linux-amd-0.0.9-v25.6.8.zip
	unzip xray-webui-linux-amd-0.0.9-v25.6.8.zip
	echo "xray-webui install Ok"	
    echo "http://127.0.0.1:1989"	
    echo "User: killer"	
    echo "Passwd: 19890604"	
}

echo "which do you want to?input the number."
echo "1. install Xray-web service"
echo "2. install Xray-web boot"

read num

case "$num" in
[1] ) (installV2);;
[2] ) (v2boot);;
*) echo "nothing,exit";;
esac
