mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-08-15 23:08:42 +02:00
remove comments
This commit is contained in:
@ -5,23 +5,14 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m
|
|||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: https://github.com/heiher/hev-socks5-server
|
# Source: https://github.com/heiher/hev-socks5-server
|
||||||
|
|
||||||
# App Default Values
|
|
||||||
APP="hev-socks5-server"
|
APP="hev-socks5-server"
|
||||||
# Name of the app (e.g. Google, Adventurelog, Apache-Guacamole"
|
|
||||||
TAGS="proxy,socks5"
|
TAGS="proxy,socks5"
|
||||||
# Tags for Proxmox VE, maximum 2 pcs., no spaces allowed, separated by a semicolon ; (e.g. database | adblock;dhcp)
|
|
||||||
var_cpu="2"
|
var_cpu="2"
|
||||||
# Number of cores (1-X) (e.g. 4) - default are 2
|
|
||||||
var_ram="1024"
|
var_ram="1024"
|
||||||
# Amount of used RAM in MB (e.g. 2048 or 4096)
|
|
||||||
var_disk="4"
|
var_disk="4"
|
||||||
# Amount of used disk space in GB (e.g. 4 or 10)
|
|
||||||
var_os="debian"
|
var_os="debian"
|
||||||
# Default OS (e.g. debian, ubuntu, alpine)
|
|
||||||
var_version="12"
|
var_version="12"
|
||||||
# Default OS version (e.g. 12 for debian, 24.04 for ubuntu, 3.20 for alpine)
|
|
||||||
var_unprivileged="1"
|
var_unprivileged="1"
|
||||||
# 1 = unprivileged container, 0 = privileged container
|
|
||||||
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
@ -33,50 +24,42 @@ function update_script() {
|
|||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
# Check if installation is present | -f for file, -d for folder
|
|
||||||
if [[ ! -f /opt/hev-socks5-server ]]; then
|
if [[ ! -f /opt/hev-socks5-server ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Crawling the new version and checking whether an update is required
|
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/heiher/hev-socks5-server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
RELEASE=$(curl -s https://api.github.com/repos/heiher/hev-socks5-server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||||
# Stopping Services
|
|
||||||
msg_info "Stopping $APP"
|
msg_info "Stopping $APP"
|
||||||
systemctl stop $APP
|
systemctl stop $APP
|
||||||
msg_ok "Stopped $APP"
|
msg_ok "Stopped $APP"
|
||||||
|
|
||||||
# Creating Backup
|
|
||||||
msg_info "Creating Backup"
|
msg_info "Creating Backup"
|
||||||
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/etc/${APP}"
|
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/etc/${APP}"
|
||||||
msg_ok "Backup Created"
|
msg_ok "Backup Created"
|
||||||
|
|
||||||
# Execute Update
|
|
||||||
msg_info "Updating $APP to v${RELEASE}"
|
msg_info "Updating $APP to v${RELEASE}"
|
||||||
git clone --recursive https://github.com/heiher/hev-socks5-server
|
git clone --recursive https://github.com/heiher/hev-socks5-server
|
||||||
cd hev-socks5-server || exit
|
cd hev-socks5-server || exit
|
||||||
make
|
make
|
||||||
mv bin/${APP} /opt/${APP}
|
mv bin/${APP} /opt/${APP}
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||||
# do not overwrite existing config
|
|
||||||
if [ ! -d "/etc/${APP}" ]; then
|
if [ ! -d "/etc/${APP}" ]; then
|
||||||
mv conf/ /etc/${APP}/
|
mv conf/ /etc/${APP}/
|
||||||
fi
|
fi
|
||||||
msg_ok "Updated $APP to v${RELEASE}"
|
msg_ok "Updated $APP to v${RELEASE}"
|
||||||
|
|
||||||
# Starting Services
|
|
||||||
msg_info "Starting $APP"
|
msg_info "Starting $APP"
|
||||||
systemctl start $APP
|
systemctl start $APP
|
||||||
msg_ok "Started $APP"
|
msg_ok "Started $APP"
|
||||||
|
|
||||||
# Cleaning up
|
|
||||||
msg_info "Cleaning Up"
|
msg_info "Cleaning Up"
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
rm -rf hev-socks5-server
|
rm -rf hev-socks5-server
|
||||||
msg_ok "Cleanup Completed"
|
msg_ok "Cleanup Completed"
|
||||||
|
|
||||||
# Last Action
|
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||||
msg_ok "Update Successful"
|
msg_ok "Update Successful"
|
||||||
else
|
else
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: https://github.com/heiher/hev-socks5-server
|
# Source: https://github.com/heiher/hev-socks5-server
|
||||||
|
|
||||||
# Import Functions und Setup
|
|
||||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||||
color
|
color
|
||||||
verb_ip6
|
verb_ip6
|
||||||
@ -14,7 +13,6 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
# Installing Dependencies with the 3 core dependencies (curl;sudo;mc)
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
@ -25,9 +23,6 @@ $STD apt-get install -y \
|
|||||||
gcc
|
gcc
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
# Temp
|
|
||||||
|
|
||||||
# Setup App (build from source)
|
|
||||||
msg_info "Setup ${APPLICATION}"
|
msg_info "Setup ${APPLICATION}"
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/heiher/hev-socks5-server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
RELEASE=$(curl -s https://api.github.com/repos/heiher/hev-socks5-server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||||
git clone --recursive https://github.com/heiher/hev-socks5-server
|
git clone --recursive https://github.com/heiher/hev-socks5-server
|
||||||
@ -35,13 +30,11 @@ cd hev-socks5-server || exit
|
|||||||
make
|
make
|
||||||
mv bin/${APPLICATION} /opt/${APPLICATION}
|
mv bin/${APPLICATION} /opt/${APPLICATION}
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||||
# do not overwrite existing config
|
|
||||||
if [ ! -d "/etc/${APPLICATION}" ]; then
|
if [ ! -d "/etc/${APPLICATION}" ]; then
|
||||||
mv conf/ /etc/${APPLICATION}/
|
mv conf/ /etc/${APPLICATION}/
|
||||||
fi
|
fi
|
||||||
msg_ok "Setup ${APPLICATION}"
|
msg_ok "Setup ${APPLICATION}"
|
||||||
|
|
||||||
# Creating Service (if needed)
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/${APPLICATION}.service
|
cat <<EOF >/etc/systemd/system/${APPLICATION}.service
|
||||||
[Unit]
|
[Unit]
|
||||||
@ -61,7 +54,6 @@ msg_ok "Created Service"
|
|||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
rm -rf "${APPLICATION}"
|
rm -rf "${APPLICATION}"
|
||||||
|
Reference in New Issue
Block a user