From 663107c7c24e1ae1a5c4fcc8c4cd3352ab2bd765 Mon Sep 17 00:00:00 2001 From: Chakib Benziane Date: Thu, 30 Jul 2020 16:32:29 +0100 Subject: [PATCH] posix shell compliant --- src/profile.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/profile.sh b/src/profile.sh index 3dbdeac..abbe12c 100644 --- a/src/profile.sh +++ b/src/profile.sh @@ -1,8 +1,11 @@ +#!/usr/bin/env sh + # To avoid potential situation where cdm(1) crashes on every TTY, here we # default to execute cdm(1) on tty1 only, and leave other TTYs untouched. -if [[ "$(tty)" == '/dev/tty1' ]]; then - [[ -n "$CDM_SPAWN" ]] && return +if [ "$(tty)" = '/dev/tty1' ]; then + [ -n "$CDM_SPAWN" ] && return # Avoid executing cdm(1) when X11 has already been started. - [[ -z "$DISPLAY$SSH_TTY$(pgrep xinit)" ]] && exec cdm + + [ -z "$DISPLAY$SSH_TTY$(pgrep xinit)" ] && exec cdm fi