aboutsummaryrefslogtreecommitdiff
path: root/home/.config/i3/status/backup
blob: dd27225fe3108074a7e2d3360eec97176652df3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

systemctl="systemctl --user"

function systemd_status() {
    unit="$1"
    if $systemctl --quiet is-active "$unit"; then
	echo ""
    elif $systemctl --quiet is-failed "$unit"; then
	echo ""
    elif ! $systemctl --quiet is-enabled "$unit"; then
	# note that !enabled includes units that have not been found
	echo ""
    else
	echo ""
    fi
}

status=""
status+="$(systemd_status unmetered-internet.target)"
status+="$(systemd_status backup.timer)"
status+="$(systemd_status backup.service)"

echo "$status"
echo "$status"