@@ -5,14 +5,14 @@ if [ -n "$SHELL" ] &&
5
5
! (echo " $SHELL " | grep -q " false" ) &&
6
6
! (echo " $SHELL " | grep -q " nologin" ); then
7
7
if [ " $1 " != ' -l' ]; then
8
- exec bash -c " exec -l '$SHELL ' -c '$0 -l $* '"
8
+ exec sh -c " exec -l '$SHELL ' -c '$0 -l $* '"
9
9
else
10
10
shift
11
11
fi
12
12
fi
13
13
14
14
# Try to detect the service manager that is being used
15
- if hash systemctl & > /dev/null; then
15
+ if hash systemctl > /dev/null 2>&1 ; then
16
16
# Make sure there's no already running session.
17
17
if systemctl --user -q is-active niri.service; then
18
18
echo ' A niri session is already running.'
@@ -41,15 +41,15 @@ if hash systemctl &> /dev/null; then
41
41
42
42
# Unset environment that we've set.
43
43
systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET
44
- elif hash dinitctl & > /dev/null; then
44
+ elif hash dinitctl > /dev/null 2>&1 ; then
45
45
# Check that the user dinit daemon is running
46
- if ! pgrep -u $( id -u) dinit & > /dev/null; then
46
+ if ! pgrep -u " $( id -u) " dinit > /dev/null 2>&1 ; then
47
47
echo " dinit user daemon is not running."
48
48
exit 1
49
49
fi
50
50
51
51
# Make sure there's no already running session.
52
- if dinitctl --user is-started niri & > /dev/null; then
52
+ if dinitctl --user is-started niri > /dev/null 2>&1 ; then
53
53
echo ' A niri session is already running.'
54
54
exit 1
55
55
fi
0 commit comments