-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprerequisites.sh
executable file
·65 lines (60 loc) · 1.68 KB
/
prerequisites.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
#!/bin/bash
if [ -z "$1" ] || [ $1 == "-h" ] || [ $1 == "--help" ]; then
echo "$0 <profiles...>"
echo "Currently available Profiles:"
echo "console"
echo "desktop"
exit
fi
if [ $(id -u) != 0 ]; then
echo "To install packages, we need root. Please rerun as root."
exit
fi
if ! [ -e /etc/os-release ]; then
echo "/etc/os-release not found. Aborting."
exit
fi
source /etc/os-release
echo "detected $ID"
for profile in "$@"; do
echo "Installing profile '$profile'"
case "$profile" in
console)
case "$ID" in
ubuntu)
apt-get update
apt-get install -y tmux git vim fzf bash-completion tree
;;
fedora)
dnf install --assumeyes tmux git vim fzf bash-completion tree
;;
opensuse-leap)
zypper install --no-confirm tmux git vim fzf bash-completion tree
;;
*)
echo "not configured"
;;
esac
;;
desktop)
case "$ID" in
fedora)
dnf groupinstall --assumeyes i3
rpm --import https://packages.microsoft.com/keys/microsoft.asc
echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo
dnf install --assumeyes xfce4-terminal xss-lock rofi maim ImageMagick keepassxc nextcloud-client fontawesome-fonts code feh remmina
;;
*)
echo "not configured"
;;
esac
;;
*)
echo "unknown profile"
continue
;;
esac
echo "success"
done
unset profile
unset sources