Skip to content

Commit 899f225

Browse files
author
dicksonarmijos
committed
exec zsh
1 parent 300121a commit 899f225

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ bash install-tools.sh
2626

2727
# OS Tested
2828
- Debian GNU/Linux 9 (stretch) 64-bit
29+
- Ubuntu 18.04.1 LTS (Bionic Beaver) 64-bit

install-tools.sh

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,23 @@
33
echo "Run install tools"
44
sleep 1
55
echo "Updating repositories.."
6-
sudo apt update
76

8-
tools_requirements=(sudo git sed make wget curl)
9-
tools_to_install=(vim tmux htop zsh nmap screen i3lock-fancy glances);
7+
comprobate_gpl(){
8+
local return_=1
9+
which $1 >/dev/null 2>&1 || { local return_=0; }
10+
echo "$return_"
11+
}
12+
13+
yum=$(comprobate_gpl "yum")
14+
apt=$(comprobate_gpl "apt")
15+
if [ $apt -eq "1" ]; then
16+
sudo apt update
17+
elif [ $yum -eq "1" ]; then
18+
sudo yum update
19+
fi
20+
21+
tools_requirements=(git sed make wget curl)
22+
tools_to_install=(vim tmux htop nmap screen i3lock-fancy glances zsh);
1023
plugins_zsh=(git docker npm python sudo systemd web-search)
1124

1225

@@ -32,7 +45,11 @@ check_tool_and_install(){
3245
echo_pass $1
3346
else
3447
echo_fail $1
35-
sudo apt install $1 -y
48+
if [ $apt -eq "1" ]; then
49+
sudo apt install $1 -y
50+
elif [ $yum -eq "1" ]; then
51+
sudo yum install $1 -y
52+
fi
3653
if [ "$1" = "zsh" ]; then
3754
install_oh_my_zsh
3855
elif [ "$1" = "i3lock-fancy" ]; then
@@ -85,6 +102,7 @@ install_requirements(){
85102
done
86103
}
87104

105+
88106
install_requirements
89107

90108
echo "Total tools: ${#tools_to_install[@]}";

0 commit comments

Comments
 (0)