From f585930413fd3a8b0beede193f42fa5f8eab5a00 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 26 Dec 2021 16:17:39 -0500 Subject: Fixed logic error on test commands. Added command to enable ufw. Fixed git clone link. --- install.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 6b6738d..03d93ad 100755 --- a/install.sh +++ b/install.sh @@ -6,7 +6,7 @@ source deploy.conf # Change apt sources to use https sed -i "s/http:/https:/" /etc/apt/sources.list -[ -z $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 -[ -z $AMDCPU ] && apt install amd64-microcode -y -[ -z $AMDGPU ] && apt install firmware-amd-graphics -y -[ -z $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,9 +30,10 @@ apt install "$(cat packages.custom)" -y # For virtual machines -[ -z $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 enable ufw default deny incoming ufw default allow outgoing ufw default routed disabled @@ -50,12 +51,12 @@ passwd -l root echo "backing up current home directory to ~/home_backup" rsync -av $HOME/ $HOME/home_backup/ cd $HOME -git clone https://git.chudnick.com/dotfiles.git +git clone https://git.chudnick.com/dotfiles rsync --exclude .git/ --exclude LICENSE -av $HOME/dotfiles/ $HOME chsh -s $(which zsh) $USER # DWM -if [ -z $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 +67,7 @@ if [ -z $DWM ] then; fi # DWMBLOCKS -if [ -z $DWMBLOCKS ] then; +if [ ! -z $DWMBLOCKS ]; then mkdir -p $HOME/.local/src/ cd $HOME/.local/src/ sudo apt install libx11-dev -y @@ -77,10 +78,10 @@ if [ -z $DWMBLOCKS ] then; fi # SSH -[ -z $CONFIG_SSH ] && ssh-keygen +[ ! -z $CONFIG_SSH ] && ssh-keygen # SSH SERVER -[ -z $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 -[ -z $CONFIG_GPG ] && gpg --full-gen-key +[ ! -z $CONFIG_GPG ] && gpg --full-gen-key -- cgit v1.2.3