Skip to content

Commit 45f308f

Browse files
committed
remove backup and clean up
1 parent 6ce17c5 commit 45f308f

File tree

3 files changed

+16
-35
lines changed

3 files changed

+16
-35
lines changed

ct/hev-socks5-server.sh

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,19 @@ function update_script() {
2424
check_container_storage
2525
check_container_resources
2626

27-
if [[ ! -f /opt/hev-socks5-server ]]; then
27+
if [[ ! -f /opt/${APP} ]]; then
2828
msg_error "No ${APP} Installation Found!"
2929
exit
3030
fi
3131

32-
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) }')
32+
RELEASE=$(curl -s https://api.github.com/repos/heiher/${APP}/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
3333
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
3434
msg_info "Stopping $APP"
3535
systemctl stop $APP
3636
msg_ok "Stopped $APP"
3737

38-
msg_info "Creating Backup"
39-
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/etc/${APP}"
40-
msg_ok "Backup Created"
41-
4238
msg_info "Updating $APP to v${RELEASE}"
43-
curl -L -o "${APP}" "https://github.com/heiher/hev-socks5-server/releases/download/${RELEASE}/hev-socks5-server-linux-x86_64"
39+
curl -L -o "${APP}" "https://github.com/heiher/${APP}/releases/download/${RELEASE}/hev-socks5-server-linux-x86_64"
4440
mv ${APP} /opt/${APP}
4541
chmod +x /opt/${APP}
4642
msg_ok "Updated $APP to v${RELEASE}"
@@ -49,9 +45,6 @@ function update_script() {
4945
systemctl start $APP
5046
msg_ok "Started $APP"
5147

52-
msg_info "Cleaning Up"
53-
msg_ok "Cleanup Completed"
54-
5548
echo "${RELEASE}" >/opt/${APP}_version.txt
5649
msg_ok "Update Successful"
5750
else
@@ -68,4 +61,4 @@ msg_ok "Completed Successfully!\n"
6861
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
6962
echo -e "${INFO}${YW} Access it with a SOCKS5 client using the following URL:${CL}"
7063
echo -e "${TAB}${GATEWAY}${BGN}${IP}:1080${CL}"
71-
echo -e "${INFO}${YW} and the credentials stored at /root/hev.creds${CL}"
64+
echo -e "${INFO}${YW} and the credentials stored at /root/hev.creds${CL}"

install/hev-socks5-server-install.sh

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://github.com/heiher/hev-socks5-server
77

8-
# Import Functions und Setup
98
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
109
color
1110
verb_ip6
@@ -14,39 +13,29 @@ setting_up_container
1413
network_check
1514
update_os
1615

17-
# Installing Dependencies with the 3 core dependencies (curl;sudo;mc)
1816
msg_info "Installing Dependencies"
1917
$STD apt-get install -y \
2018
curl \
2119
sudo \
2220
mc
2321
msg_ok "Installed Dependencies"
2422

25-
# Temp
26-
27-
# Setup App (build from source)
2823
msg_info "Setup ${APPLICATION}"
29-
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) }')
30-
curl -L -o "${APPLICATION}" "https://github.com/heiher/hev-socks5-server/releases/download/${RELEASE}/hev-socks5-server-linux-x86_64"
24+
RELEASE=$(curl -s https://api.github.com/repos/heiher/${APPLICATION}/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
25+
curl -L -o "${APPLICATION}" "https://github.com/heiher/${APPLICATION}/releases/download/${RELEASE}/hev-socks5-server-linux-x86_64"
3126
mv ${APPLICATION} /opt/${APPLICATION}
3227
chmod +x /opt/${APPLICATION}
3328
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
34-
35-
# do not overwrite existing config
36-
if [ ! -d "/etc/${APPLICATION}" ]; then
37-
curl -L -o "main.yml" "https://raw.githubusercontent.com/heiher/hev-socks5-server/refs/heads/master/conf/main.yml"
38-
sed -i 's/^#auth:/auth:/; s/^# file: conf\/auth.txt/ file: \/root\/hev.creds/' main.yml
39-
mkdir -p /etc/${APPLICATION}
40-
41-
PASSWORD=$(openssl rand -base64 16)
42-
USERNAME="admin"
43-
MARK="0"
44-
echo "$USERNAME $PASSWORD $MARK" > /root/hev.creds
45-
mv main.yml /etc/${APPLICATION}/main.yml
46-
fi
29+
curl -L -o "main.yml" "https://raw.githubusercontent.com/heiher/${APPLICATION}/refs/heads/master/conf/main.yml"
30+
sed -i 's/^#auth:/auth:/; s/^# file: conf\/auth.txt/ file: \/root\/hev.creds/' main.yml
31+
mkdir -p /etc/${APPLICATION}
32+
USERNAME="admin"
33+
PASSWORD=$(openssl rand -base64 16)
34+
MARK="0"
35+
echo "$USERNAME $PASSWORD $MARK" > /root/hev.creds
36+
mv main.yml /etc/${APPLICATION}/main.yml
4737
msg_ok "Setup ${APPLICATION}"
4838

49-
# Creating Service (if needed)
5039
msg_info "Creating Service"
5140
cat <<EOF >/etc/systemd/system/${APPLICATION}.service
5241
[Unit]
@@ -66,7 +55,6 @@ msg_ok "Created Service"
6655
motd_ssh
6756
customize
6857

69-
# Cleanup
7058
msg_info "Cleaning up"
7159
$STD apt-get -y autoremove
7260
$STD apt-get -y autoclean

json/hev-socks5-server.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
},
3333
"notes": [
3434
{
35-
"text": "Default credentials stored at /root/hev.creds",
35+
"text": "Default credentials: `cat /root/hev.creds`",
3636
"type": "info"
3737
},
3838
{
39-
"text": "Config stored at /etc/hev-socks5-server/main.yml",
39+
"text": "Config stored at `/etc/hev-socks5-server/main.yml`",
4040
"type": "info"
4141
}
4242
]

0 commit comments

Comments
 (0)