File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,14 @@ ensure_line "nav/NAV_Sub_CA.crt" "/etc/ca-certificates.conf"
18
18
19
19
update-ca-certificates
20
20
21
- # Assert just _one_ logged-in user
22
- user_accounts=$( loginctl list-users -j | jq ' [.[] | select(.uid >= 1000)]' )
21
+ systemd_version=" $( systemctl --version | head -n 1 | grep -o ' [0-9]+' | head -n 1) "
22
+ if [[ $systemd_version -gt 255 ]]; then
23
+ user_accounts=$( loginctl list-users -j | jq ' [.[] | select(.uid >= 1000)]' )
24
+ else
25
+ user_accounts=$( loginctl list-users --output json | jq ' [.[] | select(.uid >= 1000)]' )
26
+ fi
27
+ echo $user_accounts
28
+
23
29
if echo " $user_accounts " | jq -e ' length != 1' > /dev/null; then
24
30
printf " \nMore than 1 user account logged in! naisdevice only permits _one_ user account!\n"
25
31
exit 1
You can’t perform that action at this time.
0 commit comments