From 9c24ea31f1b48005412dbc0fc3ec44e738030c5f Mon Sep 17 00:00:00 2001 From: wagesj45 Date: Fri, 25 Jul 2025 18:42:37 -0500 Subject: [PATCH] Update setup.sh --- setup.sh | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/setup.sh b/setup.sh index c69e64e..c5a01d0 100644 --- a/setup.sh +++ b/setup.sh @@ -86,24 +86,6 @@ sed -i "s/$OLD_HOST/$NEW_HOST/g" /etc/hosts hostnamectl set-hostname "$NEW_HOST" msg "Hostname set to $NEW_HOST" -############################################################################### -# SSH keys for root # -############################################################################### -install -d -m 700 /root/.ssh -chmod 700 /root/.ssh -test -n "$DEFAULT_SSH_KEY" && { - grep -qxF "$DEFAULT_SSH_KEY" /root/.ssh/authorized_keys 2>/dev/null || \ - echo "$DEFAULT_SSH_KEY" >> /root/.ssh/authorized_keys - chmod 600 /root/.ssh/authorized_keys - msg "Default SSH key added for root" -} -if confirm "Add additional SSH public key for root?"; then - KEY=$(whiptail --title "SSH Key (root)" --inputbox "Paste your public key for root:" 12 70 3>&1 1>&2 2>&3) || die "Cancelled" - grep -qxF "$KEY" /root/.ssh/authorized_keys 2>/dev/null || echo "$KEY" >> /root/.ssh/authorized_keys - chmod 600 /root/.ssh/authorized_keys - msg "Additional SSH key added for root" -fi - ############################################################################### # SSH keys for user jordanwages # ############################################################################### @@ -163,7 +145,7 @@ for host in "${CIFS_HOSTS[@]}"; do grep -q "${host}.wageshouse" /etc/fstab || printf "# $TEMPLATE\n" "username" "password" >> /etc/fstab fi done -if ! mount -a 2>>"$LOGFILE"; then msg "⚠️ Some CIFS mounts failed. Re-run the script to correct credentials."; fi +if ! (systemctl daemon-reload && mount -a) 2>>"$LOGFILE"; then msg "⚠️ Some CIFS mounts failed. Re-run the script to correct credentials."; fi ############################################################################### # Summary #