Files
runtipi/apps/rego-tunnel/build/scripts/entrypoint.sh
alexz dc463f4cf0
Some checks failed
Test / test (push) Has been cancelled
.
2026-01-16 22:44:58 +00:00

25 lines
818 B
Bash

#!/bin/bash
# Entrypoint: VNC setup + DNS fix + systemd
# Setup VNC password from environment variable (passed by runtipi)
if [ -n "$VNC_PASSWORD" ]; then
mkdir -p /root/.vnc
echo "$VNC_PASSWORD" | vncpasswd -f > /root/.vnc/passwd
chmod 600 /root/.vnc/passwd
fi
# Backup current DNS config
cp /etc/resolv.conf /tmp/resolv.conf.bak 2>/dev/null || true
cp /etc/hosts /tmp/hosts.bak 2>/dev/null || true
# Unmount Docker's bind mounts (allows VPN to modify DNS)
umount /etc/resolv.conf 2>/dev/null || true
umount /etc/hosts 2>/dev/null || true
# Restore DNS config as regular files
cat /tmp/resolv.conf.bak > /etc/resolv.conf 2>/dev/null || echo "nameserver 8.8.8.8" > /etc/resolv.conf
cat /tmp/hosts.bak > /etc/hosts 2>/dev/null || echo "127.0.0.1 localhost" > /etc/hosts
# Start systemd
exec /sbin/init