-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbootstrap-packages.sh
123 lines (94 loc) · 2.93 KB
/
bootstrap-packages.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
#!/bin/bash
#####################################################
## Warning, this file was automatically generated! ##
## Change bootstrap.org if you need to update it. ##
#####################################################
# Bash strict mode
set -euo pipefail
function setup_osx() {
echo "[-] Setting up OSX"
echo "[-] Done setting up OSX"
}
function setup_linux() {
# returns a string like "Fedora" or "Ubuntu"
DISTRO=`lsb_release -i | cut -d: -f 2 | tr -d '[:space:]'`
case $DISTRO in
Fedora)
setup_fedora
setup_linux_generic
;;
Ubuntu)
setup_ubuntu
setup_linux_generic
;;
Debian)
# We can *try* to set up Debian like Ubuntu, but it's not tested
setup_ubuntu
setup_linux_generic
;;
*)
echo "Sorry, I haven't implemented anything for this OS ($DISTRO) yet"
exit 1
esac
}
# Common things for all Linux distributions
function setup_linux_generic() {
echo "[-] Setting up generic Linux things"
echo -n "[!] Don't forget to update the max_file_descriptors, currently: "
ulimit -n
echo "[-] Done setting up generic Linux"
}
function setup_fedora() {
PACKAGES="emacs git tmux zsh htop keychain the_silver_searcher python-pip cmake"
echo "[-] Setting up Fedora"
echo "Enabling sshd..."
sudo systemctl enable sshd.service
sudo systemctl start sshd.service
# Install the minimal necessary software I need
echo "Installing software..."
sudo dnf group install -y "Development Tools"
sudo dnf group install -y "C Development Tools and Libraries"
sudo dnf install -y $PACKAGES
echo "[-] Done setting up Fedora"
}
function setup_ubuntu() {
PACKAGES="git tmux zsh htop keychain silversearcher-ag"
echo "[-] Setting up Ubuntu"
echo "Installing software..."
sudo apt-get update
sudo apt-get install -y --force-yes build-essential
sudo apt-get install -y --force-yes $PACKAGES
echo "[-] Done setting up Ubuntu"
}
function setup_generic() {
echo "[-] Setting up OS-agnostic things..."
mkdir -p ~/.zsh
if [ ! -d ~/.zsh/zsh-completions ]; then
echo "Installing zsh completions"
cd ~/.zsh && git clone https://github.com/zsh-users/zsh-completions.git
fi
if [ ! -d ~/.zsh/zsh-syntax-highlighting ]; then
echo "Installing zsh syntax highlighting"
cd ~/.zsh && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
fi
echo "[-] Done Setting up OS-agnostic things"
}
function main() {
echo "[+] Starting setup"
OS=`uname`
case $OS in
Darwin)
setup_osx
;;
Linux)
setup_linux
;;
*)
echo "Operating system ($OS) not supported!"
exit 1
esac
setup_generic
echo "[+] Finished setup"
}
### Start of actual script
main