···11-this is a small patch to stop logging IPs for https://github.com/AndersBallegaard/TCProxy
22-33-additionally, a systemd template service, which expects config directories in /srv/TCProxy/
44-with the corresponding resulting service, for example TCProxy@test.service would be /srv/TCProxy/test.
55-In there, it would look for a configuration file as per usual.
66-77-The service unit expects a compiled binary in /srv/TCProxy/TCProxy.
···11-service and timer files that we use to auto-restart the server every night at 4 AM.
-10
systemd-wait.fish/README.md
···11-# systemd-wait.fish
22-33-A small script that checks whether or not an HTTP(s) endpoint is
44-reachable before starting a list of services.
55-66-Please read the script, it isn't very long and but it is configured
77-directly in the script.
88-99-There is a sample systemd unit to run this script, but note that this
1010-is best paired with your own setup for (re)starting services.
-38
systemd-wait.fish/systemd-wait.fish
···11-#!/usr/bin/env fish
22-33-# systemd-wait.fish
44-# a small script using `curl` that lets you wait until certain endpoints return
55-# certain HTTP responses before starting services
66-77-# CONFIG:
88-set services drasl headscale headplane
99-# you must add your own endpoint to `curl` like so:
1010-set endpoint "https://auth.starlightnet.work/application/o/headplane/.well-known/openid-configuration"
1111-1212-# set initial value to false
1313-set -g serviceReachable false
1414-1515-function checkEndpoint
1616- if test (curl -o /dev/null -s -w "%{http_code}" "$endpoint") = "200"
1717- echo "HTTP 200, Service is reachable"
1818- set -g serviceReachable true
1919- return 0
2020- else
2121- echo "service is not yet reachable."
2222- set -g serviceReachable false
2323- echo "waiting 5 more seconds..."
2424- sleep 5s
2525- return 1
2626- end
2727-end
2828-2929-while test $serviceReachable = "false"
3030- checkEndpoint
3131-end
3232-3333-echo $serviceReachable
3434-3535-if test $serviceReachable = "true"
3636- echo "Starting services: $services"
3737- systemctl start $services
3838-end
-6
systemd-wait.fish/systemd-wait.service
···11-[Unit]
22-Description=systemd-wait.fish - wait for an endpoint to return before starting services
33-44-[Service]
55-Type=oneshot
66-ExecStart=/usr/local/bin/systemd-wait.fish