-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·37 lines (34 loc) · 1.07 KB
/
install.sh
File metadata and controls
executable file
·37 lines (34 loc) · 1.07 KB
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
# Installs wtd-bash-prompt
# Just a dead plain installer. Needs a ton of improvement, but shouldn't be needed for long.
function install_global() {
local INSTALLPATH=/etc/profile.d/
local SOURCEPATH=$PWD/dist/
cp "$SOURCEPATH/wtd-bash-prompt.sh" "$INSTALLPATH"
}
function install_uid() {
local INSTALLPATH=$HOME/.wtd/
local SOURCEPATH=$PWD/dist/
mkdir -p $INSTALLPATH
cp $SOURCEPATH/wtd-bash-prompt.sh $INSTALLPATH
echo ". $HOME/.wtd/wtd-bash-prompt.sh" >> $HOME/.bashrc
}
# check-uid and install for the current user or global
if [ $EUID = 0 ]; then
echo "You are running the installer as root."
echo "Do you want to install the wtd-bash-prompt as default prompt for the system? [yes|no]"
select yn in "yes" "no"; do
case $yn in
yes ) install_global; break;;
no ) exit;;
esac
done
else
echo "You are running the installer as non-root."
echo "Do you want to install the wtd-bash-prompt as default prompt for your user? [yes|no]"
select yn in "yes" "no"; do
case $yn in
yes ) install_uid; break;;
no ) exit;;
esac
done
fi