diff mbox series

[bug#40601,1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys().

Message ID 20201220172839.3059-1-vincent.legoll@gmail.com
State New
Headers show
Series [bug#40601,1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys(). | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Vincent Legoll Dec. 20, 2020, 5:28 p.m. UTC
* etc/guix-install.sh (chk_init_sys): Use `if something | grep' instead of "[["
pattern matching.
---
 etc/guix-install.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 9015f40bb6..26c8622855 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -143,11 +143,11 @@  chk_term()
 
 chk_init_sys()
 { # Return init system type name.
-    if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then
+    if /sbin/init --version 2>/dev/null | grep -q upstart; then
         _msg "${INF}init system is: upstart"
         INIT_SYS="upstart"
         return 0
-    elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then
+    elif systemctl 2>/dev/null | grep -q -- -\.mount; then
         _msg "${INF}init system is: systemd"
         INIT_SYS="systemd"
         return 0