2026-07-25 11:14:52 +03:00
|
|
|
#!/bin/sh
|
2026-07-26 09:50:04 +03:00
|
|
|
# Client-side GS-Warp launcher
|
|
|
|
|
# Created by Luxferre in 2026, released into the public domain
|
|
|
|
|
|
2026-07-25 11:14:52 +03:00
|
|
|
[ -z "$OVPNCFG" ] && OVPNCFG="$2"
|
|
|
|
|
[ -z "$OVPNCFG" ] && OVPNCFG="client.ovpn"
|
2026-07-26 09:57:21 +03:00
|
|
|
|
|
|
|
|
printf "Using config from %s...\n" "$OVPNCFG"
|
|
|
|
|
|
2026-07-26 09:50:04 +03:00
|
|
|
GS_SECRET="$(md5sum "$OVPNCFG" | cut -d ' ' -f 1)"
|
2026-07-25 11:14:52 +03:00
|
|
|
|
|
|
|
|
GSPIDFILE='/tmp/gswarp-gs.pid'
|
|
|
|
|
OVPIDFILE='/tmp/gswarp-ov.pid'
|
|
|
|
|
|
|
|
|
|
BEFORE_PIDS=$(pgrep -x gs-netcat 2>/dev/null)
|
|
|
|
|
gs-netcat -D -s "$GS_SECRET" -p 1194
|
|
|
|
|
sleep 0.5
|
|
|
|
|
AFTER_PIDS=$(pgrep -x gs-netcat 2>/dev/null)
|
|
|
|
|
|
|
|
|
|
if [ -n "$BEFORE_PIDS" ]; then
|
|
|
|
|
echo "$AFTER_PIDS" | grep -v -F -x "$BEFORE_PIDS" > "$GSPIDFILE"
|
|
|
|
|
else
|
|
|
|
|
echo "$AFTER_PIDS" > "$GSPIDFILE"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
sudo openvpn --daemon gs-warp --config "$OVPNCFG" --writepid "$OVPIDFILE"
|
|
|
|
|
|
|
|
|
|
echo 'GS-Warp started'
|