-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShellScript.sh
executable file
·127 lines (107 loc) · 4.31 KB
/
ShellScript.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash
# Determining if the user executing this script is the root user or not
# Display the UID of user
echo "Your UID is ${UID}."
# Bash has built in Variables, the above variable is one of them.
# Display if the user is root or not.
# Use the -eq if using numbers and = if using a string.
# Use double [[ ]] as this is the current preferred method, and the single brackets
# are obsolete
if [[ "${UID}" -eq 0 ]] # The spaces in the if statement are very important!
then
echo "Now starting the script"
# Script to install general things i use on my server and desktop installs
#get the system to most up to date specs....
apt update && apt upgrade -y
echo "your system has been updated and upgraded!"
read -t 5 -n 1 -s -r -p "Press any key to continue"
echo " "
# Install the software that is used.
echo "Now installing the Software on your machine "
read -t 5 -n 1 -s -r -p "Press any key to continue"
echo " "
echo "Is your system a server or a desktop OS?"
read answer
if [[ "$answer" = "server" ]]
then
read -p "Would you like the following apps will be installed. mc sl konsole cmatrix openssh-server figlet toilet apache2 mysql-server php phpmyadmin neofetch cockpit cowsay fortune [yes/no]: " SERVER
if [[ "$SERVER" = "yes" ]]
then
add-apt-repository ppa:dawidd0811/neofetch
apt update
apt install -y mc sl konsole cmatrix openssh-server apache2 mysql-server php phpmyadmin htop sshfs neofetch cockpit cockpit-* docker docker.io fortune-mod cowsay python3-pip
apt install figlet -y
echo "your applications have been"
figlet "installed!" -f standard -c
read -n 1 -s -r -p "Press any key to continue"
echo " "
echo "would you like to install RDP server? [y/n]"
read rdp
if [[ "$rdp" = "y" ]]
then
apt update
apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils -y
apt install xrdp -y
adduser xrdp ssl-cert
systemctl restart xrdp
ufw allow 3389
apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y
else
echo "No Problem."
fi
else
echo "No Programs will be installed!"
fi
else
read -p "would you like the following apps will be installed. mc yakuake sl kate konsole cmatrix openssh-server figlet toilet virtualbox virtualbox-dkms [yes/no]: " DESKTOP
if [[ "$DESKTOP" = "yes" ]]
then
add-apt-repository ppa:dawidd0811/neofetch
apt update
apt install -y mc yakuake sl kate konsole cmatrix openssh-server figlet toilet virtualbox virtualbox-dkms sshfs neofetch cockpit cockpit-* docker docker.io fortune cowsay python3-pip
echo "your applications have been"
figlet "installed!" -f standard -c
read -t 5 -n 1 -s -r -p "Press any key to continue"
echo
else
echo "No Programs will be installed!"
fi
fi
#Remove un-necessary installs!
apt install gnome-disk-utility
echo "Now removing Residual components that were not needed."
read -n 1 -s -r -p "Press any key to continue"
echo " "
apt autoremove -y
# Modify the bash.bashrc file to include the alias' i use.
echo " we will now add to your Alias section!"
read -t 5 -n 1 -s -r -p "Press any key to continue"
echo 'alias super="sudo su -"' >> /etc/bash.bashrc
echo 'alias update="sudo apt update"' >> /etc/bash.bashrc
echo 'alias upgrade="sudo apt upgrade -y"' >> /etc/bash.bashrc
echo 'alias cls="clear"' >> /etc/bash.bashrc
echo 'alias matrix="cmatrix"' >> /etc/bash.bashrc
echo 'alias external="dig +short myip.opendns.com @resolver1.opendns.com"' >> /etc/bash.bashrc
echo 'alias antserv="ssh [email protected]"' >> /etc/bash.bashrc
echo 'alias remgit="git config --global credential.helper store"' >> /etc/bash.bashrc
echo ' ' >> /etc/bash.bashrc
echo '/usr/games/fortune | /usr/games/cowthink -f tux' >> /etc/bash.bashrc
echo ' neofetch' >> /etc/bash.bashrc
echo " DONE!"
read -t 5 -n 1 -s -r -p "Press any key to continue"
# End of the script
echo " "
echo "This script has completed it's run."
read -t 5 -n 1 -s -r -p "Press any key to continue"
echo " "
echo "This script was written by the Linux Wizzard"
figlet "DARKJEDEYE"
read -t 5 -n 1 -s -r -p "Press any key to continue"
echo " "
echo "If you wish to have your own script like this, personalized with your own details."
echo "email Darkjedeye on"
echo "[email protected]"
figlet "This concludes our presentation for this evening" -f small -c
else
echo "You re not root and therefor may not install software. Please use root or sudo command."
fi