Spaces:
Paused
Paused
Update entrypoint.sh
Browse files- entrypoint.sh +8 -6
entrypoint.sh
CHANGED
|
@@ -15,7 +15,7 @@ if [ -f /run/dbus/pid ]; then
|
|
| 15 |
fi
|
| 16 |
sudo dbus-daemon --config-file=/usr/share/dbus-1/system.conf
|
| 17 |
|
| 18 |
-
# start the daemon
|
| 19 |
sudo warp-svc --accept-tos &
|
| 20 |
|
| 21 |
# sleep to wait for the daemon to start, default 2 seconds
|
|
@@ -25,18 +25,20 @@ sleep "$WARP_SLEEP"
|
|
| 25 |
if [ ! -f /var/lib/cloudflare-warp/reg.json ]; then
|
| 26 |
# if /var/lib/cloudflare-warp/mdm.xml not exists, register the warp client
|
| 27 |
if [ ! -f /var/lib/cloudflare-warp/mdm.xml ]; then
|
| 28 |
-
warp-cli
|
| 29 |
# if a license key is provided, register the license
|
| 30 |
if [ -n "$WARP_LICENSE_KEY" ]; then
|
| 31 |
echo "License key found, registering license..."
|
| 32 |
-
warp-cli
|
| 33 |
fi
|
| 34 |
fi
|
| 35 |
# connect to the warp server
|
| 36 |
warp-cli --accept-tos connect
|
| 37 |
else
|
| 38 |
-
echo "Warp client already registered,
|
| 39 |
fi
|
| 40 |
|
| 41 |
-
#
|
| 42 |
-
|
|
|
|
|
|
|
|
|
| 15 |
fi
|
| 16 |
sudo dbus-daemon --config-file=/usr/share/dbus-1/system.conf
|
| 17 |
|
| 18 |
+
# start the WARP daemon
|
| 19 |
sudo warp-svc --accept-tos &
|
| 20 |
|
| 21 |
# sleep to wait for the daemon to start, default 2 seconds
|
|
|
|
| 25 |
if [ ! -f /var/lib/cloudflare-warp/reg.json ]; then
|
| 26 |
# if /var/lib/cloudflare-warp/mdm.xml not exists, register the warp client
|
| 27 |
if [ ! -f /var/lib/cloudflare-warp/mdm.xml ]; then
|
| 28 |
+
warp-cli register && echo "Warp client registered!"
|
| 29 |
# if a license key is provided, register the license
|
| 30 |
if [ -n "$WARP_LICENSE_KEY" ]; then
|
| 31 |
echo "License key found, registering license..."
|
| 32 |
+
warp-cli register --license "$WARP_LICENSE_KEY" && echo "Warp license registered!"
|
| 33 |
fi
|
| 34 |
fi
|
| 35 |
# connect to the warp server
|
| 36 |
warp-cli --accept-tos connect
|
| 37 |
else
|
| 38 |
+
echo "Warp client already registered, skipping registration"
|
| 39 |
fi
|
| 40 |
|
| 41 |
+
# Start WARP in proxy mode on localhost
|
| 42 |
+
echo "Starting WARP in local proxy mode..."
|
| 43 |
+
warp-cli --accept-tos set-mode proxy
|
| 44 |
+
warp-cli --accept-tos connect
|