Skip to content

Commit

Permalink
Update udpgw.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
opiran-club authored Oct 25, 2023
1 parent 9f79fd5 commit 898aaf1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Install/udpgw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ install_badvpn() {
apt-get update -y
wget -O /bin/badvpn-udpgw "https://github.com/opiran-club/VPS-Optimizer/raw/main/Install/badvpn-udpgw"
chmod +x /bin/badvpn-udpgw
useradd videocall

cat > /etc/systemd/system/videocall.service << ENDOFFILE
[Unit]
Expand Down Expand Up @@ -151,16 +152,15 @@ stop_badvpn() {

status() {
main_service="videocall"
port_pattern="--listen-addr 127.0.0.1:"

if systemctl is-active --quiet $main_service; then
echo -e "${CYAN}Main Service Status:${GREEN} Running${NC}"
else
echo -e "${CYAN}Main Service Status:${RED} Not Running${NC}"
fi

for service in $(systemctl list-units --type=service --full --all | grep -o 'videocall-extra-[0-9]*.service'); do
port=$(grep -oP "$port_pattern\K\d+" /etc/systemd/system/$service)
for service in $(systemctl list-units --type=service --full --all | grep 'videocall-extra-[0-9]*.service' -o); do
port=$(echo $service | awk -F'-' '{print $3}')
if systemctl is-active --quiet $service; then
echo -e "${CYAN}Extra BadVPN Service (Port $port) Status:${GREEN} Running${NC}"
else
Expand Down

0 comments on commit 898aaf1

Please sign in to comment.