diff options
author | Sam Chudnick <sam@chudnick.com> | 2021-12-26 15:53:42 -0500 |
---|---|---|
committer | Sam Chudnick <sam@chudnick.com> | 2021-12-26 15:53:42 -0500 |
commit | 8e87c43237a52940c443b559a050d16e3ddcac9e (patch) | |
tree | 1d6778a22fcbd625fc57d0022ac232236580a5f5 | |
parent | 23d6e54e567abb0dd1f905b4f68c2e3792d001c4 (diff) |
Test with -z instead of -n
-rwxr-xr-x | install.sh | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1,4 +1,4 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/bash |
2 | 2 | ||
3 | # source configuration file | 3 | # source configuration file |
4 | source deploy.conf | 4 | source deploy.conf |
@@ -6,7 +6,7 @@ source deploy.conf | |||
6 | # Change apt sources to use https | 6 | # Change apt sources to use https |
7 | sed -i "s/http:/https:/" /etc/apt/sources.list | 7 | sed -i "s/http:/https:/" /etc/apt/sources.list |
8 | 8 | ||
9 | [ -n $BACKPORTS ] && echo "deb https://deb.debian.org/debian/ bullseye-backports main" >> \ | 9 | [ -z $BACKPORTS] && echo "deb https://deb.debian.org/debian/ bullseye-backports main" >> \ |
10 | /etc/apt/sources.list | 10 | /etc/apt/sources.list |
11 | 11 | ||
12 | # Update packages | 12 | # Update packages |
@@ -16,9 +16,9 @@ apt update -y && apt upgrade -y | |||
16 | sed -i "s/main/main contrib non-free/" /etc/apt/sources.list | 16 | sed -i "s/main/main contrib non-free/" /etc/apt/sources.list |
17 | apt update -y | 17 | apt update -y |
18 | 18 | ||
19 | [ -n $AMDCPU ] && apt install amd64-microcode -y | 19 | [ -z $AMDCPU ] && apt install amd64-microcode -y |
20 | [ -n $AMDGPU ] && apt install firmware-amd-graphics -y | 20 | [ -z $AMDGPU ] && apt install firmware-amd-graphics -y |
21 | [ -n $INTELCPU ] && apt install intel-microcode -y | 21 | [ -z $INTELCPU ] && apt install intel-microcode -y |
22 | 22 | ||
23 | # Remove contrib and non-free repos | 23 | # Remove contrib and non-free repos |
24 | sed -i "s/main contrib non-free/main/" /etc/apt/sources.list | 24 | sed -i "s/main contrib non-free/main/" /etc/apt/sources.list |
@@ -30,7 +30,7 @@ apt install "$(cat packages.custom)" -y | |||
30 | 30 | ||
31 | # For virtual machines | 31 | # For virtual machines |
32 | 32 | ||
33 | [ -n $VM ] && apt install spice-vdagent xserver-xorg-video-qxl -y | 33 | [ -z $VM ] && apt install spice-vdagent xserver-xorg-video-qxl -y |
34 | 34 | ||
35 | # basic configuration of ufw | 35 | # basic configuration of ufw |
36 | ufw default deny incoming | 36 | ufw default deny incoming |
@@ -55,7 +55,7 @@ rsync --exclude .git/ --exclude LICENSE -av $HOME/dotfiles/ $HOME | |||
55 | chsh -s $(which zsh) $USER | 55 | chsh -s $(which zsh) $USER |
56 | 56 | ||
57 | # DWM | 57 | # DWM |
58 | if [ -n $DWM ] then; | 58 | if [ -z $DWM ] then; |
59 | mkdir -p $HOME/.local/src/ | 59 | mkdir -p $HOME/.local/src/ |
60 | cd $HOME/.local/src/ | 60 | cd $HOME/.local/src/ |
61 | sudo apt install libx11-dev libx11-xcb-dev libxcb-res0-dev libxft-dev libxinerama-dev -y | 61 | sudo apt install libx11-dev libx11-xcb-dev libxcb-res0-dev libxft-dev libxinerama-dev -y |
@@ -66,7 +66,7 @@ if [ -n $DWM ] then; | |||
66 | fi | 66 | fi |
67 | 67 | ||
68 | # DWMBLOCKS | 68 | # DWMBLOCKS |
69 | if [ -n $DWMBLOCKS ] then; | 69 | if [ -z $DWMBLOCKS ] then; |
70 | mkdir -p $HOME/.local/src/ | 70 | mkdir -p $HOME/.local/src/ |
71 | cd $HOME/.local/src/ | 71 | cd $HOME/.local/src/ |
72 | sudo apt install libx11-dev -y | 72 | sudo apt install libx11-dev -y |
@@ -77,10 +77,10 @@ if [ -n $DWMBLOCKS ] then; | |||
77 | fi | 77 | fi |
78 | 78 | ||
79 | # SSH | 79 | # SSH |
80 | [ -n $CONFIG_SSH ] && ssh-keygen | 80 | [ -z $CONFIG_SSH ] && ssh-keygen |
81 | 81 | ||
82 | # SSH SERVER | 82 | # SSH SERVER |
83 | [ -n $CONFIG_SSH_SERVER ] && sudo apt install openssh-server -y && sudo ufw allow ssh | 83 | [ -z $CONFIG_SSH_SERVER ] && sudo apt install openssh-server -y && sudo ufw allow ssh |
84 | 84 | ||
85 | # GPG | 85 | # GPG |
86 | [ -n $CONFIG_GPG ] && gpg --full-gen-key | 86 | [ -z $CONFIG_GPG ] && gpg --full-gen-key |