Add install script
This commit is contained in:
26
install.sh
Normal file
26
install.sh
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Ensure necessary packages are installed
|
||||||
|
# Check if the script is being run by the root user
|
||||||
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
echo "This script must be run as root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
clear
|
||||||
|
if ! command -v jq &> /dev/null || ! command -v git &> /dev/null || ! command -v qrencode &> /dev/null || ! command -v curl &> /dev/null; then
|
||||||
|
echo "${yellow}Necessary packages are not installed. Please wait while they are being installed..."
|
||||||
|
sleep 3
|
||||||
|
echo
|
||||||
|
apt update && apt upgrade -y && apt install jq qrencode curl pwgen uuid-runtime python3 python3-pip git -y
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add alias 'hys2' for Hysteria2
|
||||||
|
if ! grep -q "alias hys2='/etc/hysteria/menu.sh'" ~/.bashrc; then
|
||||||
|
echo "alias hys2='/etc/hysteria/menu.sh'" >> ~/.bashrc
|
||||||
|
source ~/.bashrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
git clone https://github.com/ReturnFI/Hysteria2 /etc/hysteria
|
||||||
|
|
||||||
|
cd /etc/hysteria
|
||||||
|
chmod +x menu.sh
|
||||||
|
./menu.sh
|
||||||
15
menu.sh
15
menu.sh
@ -2,21 +2,6 @@
|
|||||||
|
|
||||||
source /etc/hysteria/core/scripts/utils.sh
|
source /etc/hysteria/core/scripts/utils.sh
|
||||||
|
|
||||||
# Ensure necessary packages are installed
|
|
||||||
clear
|
|
||||||
if ! command -v jq &> /dev/null || ! command -v qrencode &> /dev/null || ! command -v curl &> /dev/null; then
|
|
||||||
echo "${yellow}Necessary packages are not installed. Please wait while they are being installed..."
|
|
||||||
sleep 3
|
|
||||||
echo
|
|
||||||
apt update && apt upgrade -y && apt install jq qrencode curl pwgen uuid-runtime python3 python3-pip -y
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add alias 'hys2' for Hysteria2
|
|
||||||
if ! grep -q "alias hys2='/etc/hysteria/menu.sh'" ~/.bashrc; then
|
|
||||||
echo "alias hys2='/etc/hysteria/menu.sh'" >> ~/.bashrc
|
|
||||||
source ~/.bashrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Function to get system information
|
# Function to get system information
|
||||||
get_system_info() {
|
get_system_info() {
|
||||||
OS=$(lsb_release -d | awk -F'\t' '{print $2}')
|
OS=$(lsb_release -d | awk -F'\t' '{print $2}')
|
||||||
|
|||||||
Reference in New Issue
Block a user