From 5fee4bd515d55cb1ded1bed0c34fb89c22e01a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 23 Sep 2020 11:42:19 +0200 Subject: sentinel-proxy: try newer version --- sentinel-proxy/files/init | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 sentinel-proxy/files/init (limited to 'sentinel-proxy/files/init') diff --git a/sentinel-proxy/files/init b/sentinel-proxy/files/init new file mode 100755 index 0000000..d8df253 --- /dev/null +++ b/sentinel-proxy/files/init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=95 +STOP=10 + +start_service() { + source /lib/functions/sentinel.sh + agreed_with_eula || return 1 + + config_load sentinel + local device_token + config_get device_token main device_token "" + if ! sentinel-device-token --validate "${device_token}" --quite; then + device_token="$(sentinel-device-token --create --quite)"; + uci -q set sentinel.main.device_token="${device_token}"; + uci -q commit sentinel.main; + echo "New device token created" >&2; + fi + + cat > "/tmp/etc/sentinel-proxy.cfg" <<-EOF + device_token = "${device_token}" +EOF + + procd_open_instance + procd_set_param command /bin/sh -c 'sentinel-certgen certs --skip-renew && exec sentinel-proxy' + procd_set_param respawn 600 5 5 + procd_set_param file /etc/config/sentinel + procd_close_instance +} -- cgit v1.2.3