tails-greeter.sh 909 Bytes
Newer Older
1
2
3
4
5
#!/bin/sh

PERSISTENCE_STATE='/var/lib/live/config/tails.persistence'
PHYSICAL_SECURITY_SETTINGS='/var/lib/live/config/tails.physical_security'

Tails developers's avatar
Tails developers committed
6
7
8
_get_tg_setting() {
    if [ -r "${1}" ]; then
        . "${1}"
9
        eval "echo \${${2}:-}"
10
    fi
Tails developers's avatar
Tails developers committed
11
12
13
14
}

persistence_is_enabled() {
    [ "$(_get_tg_setting "${PERSISTENCE_STATE}" TAILS_PERSISTENCE_ENABLED)" = true ]
15
16
}

17
18
19
20
21
22
23
24
25
persistence_is_enabled_for() {
    persistence_is_enabled && mountpoint -q "$1" 2>/dev/null
}

persistence_is_enabled_read_write() {
    persistence_is_enabled && \
    [ "$(_get_tg_setting "${PERSISTENCE_STATE}" TAILS_PERSISTENCE_READONLY)" != true ]
}

26
27
28
mac_spoof_is_enabled() {
    # Only return false when explicitly told so to increase failure
    # safety.
Tails developers's avatar
Tails developers committed
29
    [ "$(_get_tg_setting "${PHYSICAL_SECURITY_SETTINGS}" TAILS_MACSPOOF_ENABLED)" != false ]
30
}
31
32

tails_netconf() {
Tails developers's avatar
Tails developers committed
33
    _get_tg_setting "${PHYSICAL_SECURITY_SETTINGS}" TAILS_NETCONF
34
}