-
Notifications
You must be signed in to change notification settings - Fork 10
/
install.sh
27 lines (20 loc) · 870 Bytes
/
install.sh
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
#!/bin/bash
# Error handling
function error()
{
echo -e "[ `date` ] $(tput setaf 1)$@$(tput sgr0)"
exit $2
}
# Execute: apt-get update
apt-get update \
|| error "Unable to execute apt-get update command, exit status = " $?
apt-get dist-upgrade \
|| error "Unable to execute apt-get dist-upgrade command, exit status = " $?
# Install required packages
apt-get -y install python-software-properties software-properties-common sudo vim screen pv htop curl wget \
|| error "Unable to install required packages, exit status = " $?
# Custom Prompt PS1
cp -av /etc/skel/.bashrc /etc/skel/.profile /root/ \
|| error "Unable to copy /etc/skel files, exit status = " $?
echo 'PS1="\`if [ \$? = 0 ]; then echo \[\e[37m\]^_^[\u@\H:\w]\\$ \[\e[0m\]; else echo \[\e[31m\]O_O[\u@\H:\w]\\$ \[\e[0m\]; fi\`"' >> /root/.bashrc \
|| error "Unable to setup PS1, exit status = " $?