From 486b06b4125c00dd6ffce079432022a11930ce01 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 19 May 2017 12:39:14 +0000 Subject: Add execline-startup and execline-shell to examples/ again --- examples/etc/env-startup/EDITOR | 1 + examples/etc/env-startup/GZIP | 1 + examples/etc/env-startup/LC_CTYPE | 1 + examples/etc/env-startup/LESS | 1 + examples/etc/env-startup/LESSCHARSET | 1 + examples/etc/env-startup/MAIL | 0 examples/etc/env-startup/PAGER | 1 + examples/etc/env-startup/PATH | 1 + examples/etc/env-startup/SHELL | 1 + examples/etc/env-startup/VISUAL | 1 + examples/etc/execline-shell | 18 ++++++++++++++++++ examples/etc/execline-startup | 15 +++++++++++++++ 12 files changed, 42 insertions(+) create mode 100644 examples/etc/env-startup/EDITOR create mode 100644 examples/etc/env-startup/GZIP create mode 100644 examples/etc/env-startup/LC_CTYPE create mode 100644 examples/etc/env-startup/LESS create mode 100644 examples/etc/env-startup/LESSCHARSET create mode 100644 examples/etc/env-startup/MAIL create mode 100644 examples/etc/env-startup/PAGER create mode 100644 examples/etc/env-startup/PATH create mode 100644 examples/etc/env-startup/SHELL create mode 100644 examples/etc/env-startup/VISUAL create mode 100755 examples/etc/execline-shell create mode 100755 examples/etc/execline-startup (limited to 'examples') diff --git a/examples/etc/env-startup/EDITOR b/examples/etc/env-startup/EDITOR new file mode 100644 index 0000000..7c74f87 --- /dev/null +++ b/examples/etc/env-startup/EDITOR @@ -0,0 +1 @@ +vi diff --git a/examples/etc/env-startup/GZIP b/examples/etc/env-startup/GZIP new file mode 100644 index 0000000..6514c51 --- /dev/null +++ b/examples/etc/env-startup/GZIP @@ -0,0 +1 @@ +-r9 diff --git a/examples/etc/env-startup/LC_CTYPE b/examples/etc/env-startup/LC_CTYPE new file mode 100644 index 0000000..927508f --- /dev/null +++ b/examples/etc/env-startup/LC_CTYPE @@ -0,0 +1 @@ +en_US.UTF-8 diff --git a/examples/etc/env-startup/LESS b/examples/etc/env-startup/LESS new file mode 100644 index 0000000..d963b9c --- /dev/null +++ b/examples/etc/env-startup/LESS @@ -0,0 +1 @@ +-fMqrIX -b16 -z-2 diff --git a/examples/etc/env-startup/LESSCHARSET b/examples/etc/env-startup/LESSCHARSET new file mode 100644 index 0000000..5546241 --- /dev/null +++ b/examples/etc/env-startup/LESSCHARSET @@ -0,0 +1 @@ +utf8 diff --git a/examples/etc/env-startup/MAIL b/examples/etc/env-startup/MAIL new file mode 100644 index 0000000..e69de29 diff --git a/examples/etc/env-startup/PAGER b/examples/etc/env-startup/PAGER new file mode 100644 index 0000000..c96a5ab --- /dev/null +++ b/examples/etc/env-startup/PAGER @@ -0,0 +1 @@ +less diff --git a/examples/etc/env-startup/PATH b/examples/etc/env-startup/PATH new file mode 100644 index 0000000..cbd04b7 --- /dev/null +++ b/examples/etc/env-startup/PATH @@ -0,0 +1 @@ +/usr/local/bin:/usr/bin:/bin diff --git a/examples/etc/env-startup/SHELL b/examples/etc/env-startup/SHELL new file mode 100644 index 0000000..0a59cfa --- /dev/null +++ b/examples/etc/env-startup/SHELL @@ -0,0 +1 @@ +/etc/execline-shell diff --git a/examples/etc/env-startup/VISUAL b/examples/etc/env-startup/VISUAL new file mode 100644 index 0000000..7c74f87 --- /dev/null +++ b/examples/etc/env-startup/VISUAL @@ -0,0 +1 @@ +vi diff --git a/examples/etc/execline-shell b/examples/etc/execline-shell new file mode 100755 index 0000000..ac8c141 --- /dev/null +++ b/examples/etc/execline-shell @@ -0,0 +1,18 @@ +#!/bin/execlineb -S0 + +backtick -n defaulthome +{ + if -nt + { + backtick -n defaultuser { id -un } + importas -u defaultuser defaultuser + importas -D $defaultuser USER USER + redirfd -w 2 /dev/null + homeof ${USER} + } + s6-echo / +} +importas -u defaulthome defaulthome +importas -D $defaulthome HOME HOME +tryexec { ${HOME}/.execline-shell $@ } +/bin/sh $@ diff --git a/examples/etc/execline-startup b/examples/etc/execline-startup new file mode 100755 index 0000000..4afc557 --- /dev/null +++ b/examples/etc/execline-startup @@ -0,0 +1,15 @@ +#!/bin/execlineb -S0 + +/bin/multisubstitute +{ + importas -i HOME HOME + importas -i LOGNAME LOGNAME +} +/bin/export USER ${LOGNAME} +/bin/s6-envdir /etc/env-startup +/bin/fdblock 0 +/bin/fdblock 1 +/bin/fdblock 2 + +/bin/tryexec { ${HOME}/.execline-loginshell $@ } +/etc/execline-shell $@ -- cgit 1.4.1