mirror of
https://github.com/wweir/sower.git
synced 2026-10-20 16:21:35 +00:00
Installing sower meant grabbing a tarball and wiring the service up by hand, and the packaged unit was too fragile for something a resolver depends on (on-failure restart after 1min, no memory limit). Add install.sh: detects the platform and init system, installs or upgrades the binary atomically, keeps an existing config, verifies the release SHA256SUMS unless explicitly opted out, and registers the service on systemd, OpenWrt procd or macOS launchd. Every network call carries an explicit timeout, the OpenWrt init script ships in Linux tarballs, the release workflow generates SHA256SUMS, the README documents the installer, and make test syntax-checks the scripts.
22 lines
517 B
Bash
22 lines
517 B
Bash
#!/bin/sh /etc/rc.common
|
|
# OpenWrt procd service for the sower client.
|
|
# install.sh rewrites PROG/CONF to the paths it installed into.
|
|
|
|
START=99
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
PROG=/usr/sbin/sower
|
|
CONF=/etc/sower/sower.toml
|
|
|
|
start_service() {
|
|
procd_open_instance
|
|
procd_set_param command "$PROG" -c "$CONF"
|
|
# The system resolver may point at this service, so respawn must be on.
|
|
procd_set_param respawn
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_set_param limits nofile="65535 65535"
|
|
procd_close_instance
|
|
}
|