diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-05-19 12:39:14 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-05-19 12:39:14 +0000 |
commit | 486b06b4125c00dd6ffce079432022a11930ce01 (patch) | |
tree | c8db5f303c1b6b3bc160d2eee25b2a62e0e517ab | |
parent | 80e1bb78abff39447d6312d837dd0d8155e63c8a (diff) | |
download | execline-486b06b4125c00dd6ffce079432022a11930ce01.tar.gz execline-486b06b4125c00dd6ffce079432022a11930ce01.tar.xz execline-486b06b4125c00dd6ffce079432022a11930ce01.zip |
Add execline-startup and execline-shell to examples/ again
-rw-r--r-- | doc/execline-shell.html | 7 | ||||
-rw-r--r-- | doc/execline-startup.html | 5 | ||||
-rw-r--r-- | examples/etc/env-startup/EDITOR | 1 | ||||
-rw-r--r-- | examples/etc/env-startup/GZIP | 1 | ||||
-rw-r--r-- | examples/etc/env-startup/LC_CTYPE | 1 | ||||
-rw-r--r-- | examples/etc/env-startup/LESS | 1 | ||||
-rw-r--r-- | examples/etc/env-startup/LESSCHARSET | 1 | ||||
-rw-r--r-- | examples/etc/env-startup/MAIL | 0 | ||||
-rw-r--r-- | examples/etc/env-startup/PAGER | 1 | ||||
-rw-r--r-- | examples/etc/env-startup/PATH | 1 | ||||
-rw-r--r-- | examples/etc/env-startup/SHELL | 1 | ||||
-rw-r--r-- | examples/etc/env-startup/VISUAL | 1 | ||||
-rwxr-xr-x | examples/etc/execline-shell | 18 | ||||
-rwxr-xr-x | examples/etc/execline-startup | 15 |
14 files changed, 49 insertions, 5 deletions
diff --git a/doc/execline-shell.html b/doc/execline-shell.html index b14c48d..02449c7 100644 --- a/doc/execline-shell.html +++ b/doc/execline-shell.html @@ -20,7 +20,8 @@ <p> <tt>execline-shell</tt> executes <tt>$HOME/.execline-shell</tt> -with the arguments it is given. +if available (or <tt>/bin/sh</tt> otherwise) with the arguments +it is given. </p> <h2> Interface </h2> @@ -34,7 +35,7 @@ with the arguments it is given. <tt>${HOME}/.execline-shell $@</tt>. </li> <li><tt>${HOME}/.execline-shell</tt> must be readable and executable by the user. It must exec into an interactive -shell with <tt>$@</tt> as its argument.</li> +shell with <tt>$@</tt> as its argument. </li> </ul> <h2> Notes </h2> @@ -46,7 +47,7 @@ shell configuration in any language, since the <tt>${HOME}/.execline-shell</tt> file can be any executable program. <tt>${HOME}/.execline-shell</tt> can be seen as a portable <tt>.<em>whatever</em>rc</tt> file. </li> <li> As an administrator-modifiable configuration file, <tt>execline-shell</tt> -provided in execline's <tt>etc/</tt> subdirectory, and should be copied by +provided in execline's <tt>examples/etc/</tt> subdirectory, and should be copied by the administrator to <tt>/etc</tt>. </li> </ul> diff --git a/doc/execline-startup.html b/doc/execline-startup.html index ccbdb56..69b3797 100644 --- a/doc/execline-startup.html +++ b/doc/execline-startup.html @@ -33,7 +33,8 @@ login initialization, then executes <tt>${HOME}/.execline-loginshell</tt>. <li> <tt>execline-startup</tt> sets the <tt>SHELL</tt> environment variable to <tt>/etc/execline-shell</tt>. It then performs some system-specific initialization, and -transforms itself into <tt>${HOME}/.execline-loginshell $@</tt>. </li> +transforms itself into <tt>${HOME}/.execline-loginshell $@</tt> +if available (and <tt>/etc/execline-shell</tt> otherwise). </li> <li><tt>${HOME}/.execline-loginshell</tt> must be readable and executable by the user. It must exec into <tt>$SHELL $@</tt>. </li> </ul> @@ -46,7 +47,7 @@ executable by the user. It must exec into <tt>$SHELL $@</tt>. </li> and modifiable. It is meant to be modified by the system administrator to perform system-specific login-time initialization. </li> <li> As a modifiable configuration file, execline-startup is provided in execline's -<tt>etc/</tt> subdirectory, and should be copied by the administrator +<tt>examples/etc/</tt> subdirectory, and should be copied by the administrator to <tt>/etc</tt>. </li> <li> <tt>execline-startup</tt> is meant to be used as a login shell. System administrators should manually add <tt>/etc/execline-startup</tt> 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 --- /dev/null +++ b/examples/etc/env-startup/MAIL 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 $@ |