2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
7 # Make sure PATH is set
8 systemctl show-environment |
grep -q '^PATH='
10 # Let's add an entry and override a built-in one
11 systemctl set-environment PATH
=/usr
/local
/sbin
:/usr
/local
/bin
:/usr
/sbin
:/usr
/bin
:/testaddition FOO
=BAR
13 # Check that both are set
14 systemctl show-environment |
grep -q '^PATH=.*testaddition$'
15 systemctl show-environment |
grep -q '^FOO=BAR$'
17 systemctl daemon-reload
19 # Check again after the reload
20 systemctl show-environment |
grep -q '^PATH=.*testaddition$'
21 systemctl show-environment |
grep -q '^FOO=BAR$'
24 systemctl unset-environment FOO PATH
26 # Check that one is gone and the other reverted to the built-in
27 ! (systemctl show-environment |
grep -q '^FOO=$')
28 ! (systemctl show-environment |
grep -q '^PATH=.*testaddition$')
29 systemctl show-environment |
grep -q '^PATH='