forked from ilude/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup_zsh.sh
executable file
·51 lines (48 loc) · 1.33 KB
/
setup_zsh.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
#!/bin/bash
OS=$(uname -s | tr A-Z a-z)
PACKAGES="make zsh zsh-autosuggestions zsh-syntax-highlighting"
case $OS in
linux)
source /etc/os-release
case $ID in
debian|ubuntu|mint)
if [[ "$EUID" -ne 0 ]]; then
sudo apt update
sudo apt -y install $PACKAGES python3-dev python3-pip python3-setuptools
else
apt update
apt -y install $PACKAGES python3-dev python3-pip python3-setuptools
fi
;;
alpine)
if [[ "$EUID" -ne 0 ]]; then
sudo apk add --update $PACKAGES shadow py3-pip py3-setuptools
echo "auth sufficient pam_rootok.so" | sudo tee /etc/pam.d/chsh
else
apk add --update $PACKAGES
fi
;;
fedora|rhel|centos)
if [[ "$EUID" -ne 0 ]]; then
sudo yum install $PACKAGES python3-dev python3-pip python3-setuptools
else
yum install $PACKAGES python3-dev python3-pip python3-setuptools
fi
;;
*)
echo -n "unsupported linux distro"
;;
esac
;;
*)
echo -n "unsupported OS"
;;
esac
# check if we are in proxmox
if [[ "$EUID" -ne 0 ]]; then
echo Setting $(whoami) shell to $(which zsh)
sudo chsh -s $(which zsh) $(whoami)
else
echo Setting $(whoami) shell to $(which zsh)
chsh -s $(which zsh) $(whoami)
fi