Rebuild rego-tunnel-linux with systemd as init
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2025-12-25 01:08:20 +00:00
parent 06662a294b
commit a17fe5843d
7 changed files with 121 additions and 3 deletions

View File

@@ -0,0 +1,31 @@
#!/bin/bash
# Pre-start setup for Rego VPN
# Add VPN hosts entries
grep -q "vpn-ord1.dovercorp.com" /etc/hosts || echo "162.209.24.100 vpn-ord1.dovercorp.com" >> /etc/hosts
grep -q "vpn.dovercorp.com" /etc/hosts || echo "13.67.192.27 vpn.dovercorp.com" >> /etc/hosts
# Setup TUN device
mkdir -p /dev/net
if [ ! -c /dev/net/tun ]; then
mknod /dev/net/tun c 10 200 2>/dev/null || true
chmod 600 /dev/net/tun
fi
# Enable IP forwarding
sysctl -w net.ipv4.ip_forward=1 >/dev/null 2>&1 || true
# Load TUN module
/opt/cisco/secureclient/bin/load_tun.sh 2>/dev/null || true
# Clean up stale IPC socket
rm -f /root/.cisco/hostscan/.libcsd.ipc 2>/dev/null || true
# Setup VNC password
mkdir -p /root/.vnc
x11vnc -storepasswd "${VNC_PASSWORD:-vpnpass}" /root/.vnc/pass >/dev/null 2>&1 || true
# Clean up old X locks
rm -f /tmp/.X1-lock /tmp/.X11-unix/X1 2>/dev/null || true
echo "Rego VPN setup complete"