summaryrefslogtreecommitdiffstats
path: root/pts/distro-scripts/install-ubuntu-packages.sh
blob: e9682527ca5135ad86b020ac1e59cab9b0b1d152 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# Portions based on Debian fglrx install script
# http://phorogit.com/index.php?p=fglrx-packaging.git&b=c67ac96d765ca95130bd07cb240ab69cfc06baa2

if [ `whoami` != "root" ]; then
	if [ -x /usr/bin/gksudo ] && [ ! -z "$DISPLAY" ]; then
		ROOT="/usr/bin/gksudo"
	elif [ -x /usr/bin/kdesu ] && [ ! -z "$DISPLAY" ]; then
		ROOT="/usr/bin/kdesu"
	elif [ -x /usr/bin/sudo ]; then
		ROOT="/usr/bin/sudo"
	fi
else
	ROOT=""
fi

# if [ -x /usr/sbin/synaptic ] && [ ! -z "$DISPLAY" ]; then
#	$ROOT "sh -c 'echo \"$@ install\" | /usr/sbin/synaptic --set-selections --non-interactive --hide-main-window'"
# else
	$ROOT "apt-get -y install $*"
# fi