dot

packages and services management
Log | Files | Refs | README

commit 81170e1a5dc3456ccc88ef98566caa413fb432d3
parent 133dfde26bbf330ed4ca1d70f8e10bfe92d2025a
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun,  8 Jul 2018 13:14:36 +0200

configure programs with ./env/VAR

Diffstat:
Abin/s6 | 26++++++++++++++++++++++++++
Ds6/s6 | 25-------------------------
As6/tinysshd/env/PORT | 1+
Ms6/tinysshd/run | 5++++-
4 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/bin/s6 b/bin/s6 @@ -0,0 +1,26 @@ +#!/bin/sh -e + +service=/etc/s6/ +export PATH="$PATH:/local/bin" + +case $1 in +(start) + exec s6-svscan $service 2>&1 | exec s6-log t /var/log/s6-svscan/ & + ;; +(stop) + exec s6-svscanctl -t $service + ;; +(reload) + exec s6-svscanctl -a $service + ;; +(restart) + "$0" stop + exec "$0" start + ;; +(check) + exec pgrep s6-svscan + ;; +(*) + exec echo "usage: $(basename "$0") {start,stop,restart,reload,check}" + ;; +esac diff --git a/s6/s6 b/s6/s6 @@ -1,25 +0,0 @@ -#!/bin/sh -e - -test $# = 0 && exec echo "usage: $0 start|stop|restart|reload|check" - -service=/service/ -export PATH="$PATH:/usr/local/bin" - -case $1 in -(start) - exec s6-svscan $service 2>&1 | exec s6-log t /var/log/s6-svscan/ & - ;; -(stop) - exec s6-svscanctl -t $service - ;; -(reload) - exec s6-svscanctl -a $service - ;; -(restart) - "$0" stop - exec "$0" start - ;; -(check) - exec pgrep s6-svscan - ;; -esac diff --git a/s6/tinysshd/env/PORT b/s6/tinysshd/env/PORT @@ -0,0 +1 @@ +22 diff --git a/s6/tinysshd/run b/s6/tinysshd/run @@ -7,5 +7,8 @@ foreground { mkdir -p ./data/ } foreground { if { test ! -d ./data/key/ } tinysshd-makekey ./data/key/ } foreground { chmod 500 ./data/key/ } -s6-tcpserver 0.0.0.0 22 +s6-envdir ./env/ +importas PORT PORT + +s6-tcpserver 0.0.0.0 ${PORT} tinysshd -sovv ./data/key/