summaryrefslogtreecommitdiff
path: root/config/chroot_local-includes/lib/live/config/900-sudo-su-alias
blob: 1f7b891e721a0491d3fd5b30398bd88ce592ae69 (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/sudo-su-alias ]
	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