aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <somasis@exherbo.org>2016-07-17 14:33:48 -0400
committerKylie McClain <somasis@exherbo.org>2016-07-17 14:34:06 -0400
commit5bffd0ddd6419bdb039360a75567f5d7602e6bf7 (patch)
tree8751b8ea71fb6d340f7be8110663e0c1c7c35f8c
parent9eda1ec3ea6d065a392c0f0494a40920e1bae504 (diff)
downloads6-exherbo-5bffd0ddd6419bdb039360a75567f5d7602e6bf7.tar.gz
s6-exherbo-5bffd0ddd6419bdb039360a75567f5d7602e6bf7.tar.xz
s6-exherbo-5bffd0ddd6419bdb039360a75567f5d7602e6bf7.zip
init2: Move init2 functionality to libexec/s6/init2.sh
-rwxr-xr-xlib/s6/init211
-rw-r--r--libexec/s6/init2.sh9
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/s6/init2 b/lib/s6/init2
index e28ea9b..19dc454 100755
--- a/lib/s6/init2
+++ b/lib/s6/init2
@@ -1,13 +1,8 @@
#!/bin/execlineb -P
-if { s6-rc-init /run/s6/service }
+redirfd -w 1 /dev/console
-# Try state-normal, else fallback to state-basic
-if -nt {
- pipeline { s6-rc-db list bundles } grep -q state-normal
- s6-rc -u change state-normal
-}
+if { s6-rc-init /run/s6/service }
-redirfd -w 1 /dev/console
-s6-rc -u change state-basic
+/usr/libexec/s6/init2.sh
diff --git a/libexec/s6/init2.sh b/libexec/s6/init2.sh
new file mode 100644
index 0000000..b730451
--- /dev/null
+++ b/libexec/s6/init2.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Try state-normal, else fallback to state-basic
+if s6-rc-db list bundles | grep -xFq state-normal;then
+ s6-rc -u change state-normal
+else
+ s6-rc -u change state-basic
+fi
+