blob: 56589a314a7918dce77a8eb2a1544821dc495655 (
plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/bin/sh
# live-config(7) - System Configuration Scripts
# Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
#
# live-config comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
# This is free software, and you are welcome to redistribute it
# under certain conditions; see COPYING for details.
Sudoalias ()
{
# Checking if package is already configured
if [ -e /var/lib/live/config/sudoalias ]
then
return
fi
echo -n " sudoalias"
Configure_sudoalias
}
Configure_sudoalias ()
{
# Checking if if package is already configured differently
if grep -q "livecd password hook" /home/${LIVE_USERNAME}/.bashrc
then
return
fi
sudo -u "${LIVE_USERNAME}" sh -c "cat >> /home/${LIVE_USERNAME}/.bashrc" << EOF
# livecd password hook
alias su="sudo su"
alias sux="sudo sux"
EOF
# Creating state file
touch /var/lib/live/config/sudoalias
}
Sudoalias
|