From 231d37a853d7f96ca0e6b2e780a2c95b97eace99 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 15 Jul 2022 17:26:08 +0200 Subject: ele-sms: add sachet --- inventory/host_vars/ele-sms.yml | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/inventory/host_vars/ele-sms.yml b/inventory/host_vars/ele-sms.yml index c2f5317c..f65d95a2 100644 --- a/inventory/host_vars/ele-sms.yml +++ b/inventory/host_vars/ele-sms.yml @@ -42,6 +42,39 @@ openwrt_mixin: /etc/htoprc: file: "{{ global_files_dir }}/common/htoprc" + /etc/rc.d/S95sachet: + link: "../init.d/sachet" + + /etc/init.d/sachet: + mode: "0755" + content: | + #!/bin/sh /etc/rc.common + + START=95 + USE_PROCD=1 + + start_service() { + procd_open_instance + + procd_set_param command /root/sachet -config /etc/sachet.yml + procd_set_param respawn + procd_set_param stdout 1 + + procd_close_instance + } + + /etc/sachet.yml: + content: | + providers: + smstools: + outgoing_dir: /var/spool/sms/outgoing + + receivers: + - name: 'equinox' + provider: 'smstools' + to: + - '+436644800222' + /etc/usb-mode.json: content: | { @@ -148,3 +181,14 @@ openwrt_uci: prometheus_scrape_endpoint: "{{ network_zones.lan.prefix | ipaddr(network_zones.lan.offsets[inventory_hostname]) | ipaddr('address') }}:9100" prometheus_exporters_default: - openwrt + + +### TODO: +# +# git clone github:spreadspace/sachet +# git checkout topic/add-smstools +# cd sachet/cmd/sachet +# export GOARCH=386 +# export GO386=softfloat +# go build -a -installsuffix cgo -mod vendor -o ../../sachet . +# scp ../../sachet ele-sms:/root/sachet -- cgit v1.2.3