replace-su-with-sudo.sh 464 Bytes
Newer Older
1
2
3
4
5
#!/bin/bash

# Replace su by a message to use sudo
# https://redmine.tails.boum.org/code/issues/15583

6
7
8
9
10
11
12
13
14
# Get LANG
. /etc/default/locale
export LANG

# Initialize gettext support
. gettext.sh
TEXTDOMAIN="tails"
export TEXTDOMAIN

15
16
17
18
19
[ $USER == root ] && return

su (){
    tails_is_password_set.py
    if [ $? -eq 0 ]; then
20
        "`gettext \"su is disabled. Please use sudo instead.\"`"
21
22
23
24
    else
        cat /usr/share/tails-greeter/no-password-lecture.txt
    fi
}