From 8e87c43237a52940c443b559a050d16e3ddcac9e Mon Sep 17 00:00:00 2001
From: Sam Chudnick <sam@chudnick.com>
Date: Sun, 26 Dec 2021 15:53:42 -0500
Subject: Test with -z instead of -n

---
 install.sh | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/install.sh b/install.sh
index ca9cafa..6b6738d 100755
--- a/install.sh
+++ b/install.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # source configuration file
 source deploy.conf
@@ -6,7 +6,7 @@ source deploy.conf
 # Change apt sources to use https
 sed -i "s/http:/https:/" /etc/apt/sources.list
 
-[ -n $BACKPORTS ] && echo "deb https://deb.debian.org/debian/ bullseye-backports main" >> \
+[ -z $BACKPORTS] && echo "deb https://deb.debian.org/debian/ bullseye-backports main" >> \
 		/etc/apt/sources.list
 
 # Update packages
@@ -16,9 +16,9 @@ apt update -y && apt upgrade -y
 sed -i "s/main/main contrib non-free/" /etc/apt/sources.list
 apt update -y
 
-[ -n $AMDCPU ] && apt install amd64-microcode -y
-[ -n $AMDGPU ] && apt install firmware-amd-graphics -y
-[ -n $INTELCPU ] && apt install intel-microcode -y
+[ -z $AMDCPU ] && apt install amd64-microcode -y
+[ -z $AMDGPU ] && apt install firmware-amd-graphics -y
+[ -z $INTELCPU ] && apt install intel-microcode -y
 
 # Remove contrib and non-free repos
 sed -i "s/main contrib non-free/main/" /etc/apt/sources.list
@@ -30,7 +30,7 @@ apt install "$(cat packages.custom)" -y
 
 # For virtual machines
 
-[ -n $VM ] && apt install spice-vdagent xserver-xorg-video-qxl -y
+[ -z $VM ] && apt install spice-vdagent xserver-xorg-video-qxl -y
 
 # basic configuration of ufw
 ufw default deny incoming
@@ -55,7 +55,7 @@ rsync --exclude .git/ --exclude LICENSE -av $HOME/dotfiles/ $HOME
 chsh -s $(which zsh) $USER
 
 # DWM
-if [ -n $DWM ] then;
+if [ -z $DWM ] then;
 	mkdir -p $HOME/.local/src/
 	cd $HOME/.local/src/
 	sudo apt install libx11-dev libx11-xcb-dev libxcb-res0-dev libxft-dev libxinerama-dev -y
@@ -66,7 +66,7 @@ if [ -n $DWM ] then;
 fi
 
 # DWMBLOCKS
-if [ -n $DWMBLOCKS ] then;
+if [ -z $DWMBLOCKS ] then;
 	mkdir -p $HOME/.local/src/
 	cd $HOME/.local/src/
 	sudo apt install libx11-dev -y
@@ -77,10 +77,10 @@ if [ -n $DWMBLOCKS ] then;
 fi
 
 # SSH
-[ -n $CONFIG_SSH ] && ssh-keygen 
+[ -z $CONFIG_SSH ] && ssh-keygen 
 
 # SSH SERVER
-[ -n $CONFIG_SSH_SERVER ] && sudo apt install openssh-server -y && sudo ufw allow ssh
+[ -z $CONFIG_SSH_SERVER ] && sudo apt install openssh-server -y && sudo ufw allow ssh
 
 # GPG
-[ -n $CONFIG_GPG ] && gpg --full-gen-key
+[ -z $CONFIG_GPG ] && gpg --full-gen-key
-- 
cgit v1.2.3