From 692effd5c347bbe6086d52b30c06739c92b206f5 Mon Sep 17 00:00:00 2001 From: wesley800 Date: Thu, 15 Sep 2022 11:54:50 +0800 Subject: [PATCH] remove exit from ssh_setup.*sh --- overlays/host/etc/profile.d/ssh_setup.csh | 7 +------ overlays/host/etc/profile.d/ssh_setup.sh | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/overlays/host/etc/profile.d/ssh_setup.csh b/overlays/host/etc/profile.d/ssh_setup.csh index 5d810032..8befc753 100644 --- a/overlays/host/etc/profile.d/ssh_setup.csh +++ b/overlays/host/etc/profile.d/ssh_setup.csh @@ -5,12 +5,7 @@ set _UID=`id -u` -if ( $_UID < 500 && $_UID != 0 ) then - exit -endif - - -if ( ! -f "$HOME/.ssh/config" && ! -f "$HOME/.ssh/cluster" ) then +if ( ( $_UID > 500 || $_UID == 0 ) && ( ! -f "$HOME/.ssh/config" && ! -f "$HOME/.ssh/cluster" ) ) then echo "Configuring SSH for cluster access" install -d -m 700 $HOME/.ssh ssh-keygen -t rsa -f $HOME/.ssh/cluster -N '' -C "Warewulf Cluster key" >& /dev/null diff --git a/overlays/host/etc/profile.d/ssh_setup.sh b/overlays/host/etc/profile.d/ssh_setup.sh index c54e46bc..daa1dfb8 100644 --- a/overlays/host/etc/profile.d/ssh_setup.sh +++ b/overlays/host/etc/profile.d/ssh_setup.sh @@ -13,12 +13,7 @@ _UID=`id -u` -if [ $_UID -lt 500 -a $_UID -ne 0 ]; then - exit -fi - - -if [ ! -f "$HOME/.ssh/config" -a ! -f "$HOME/.ssh/cluster" ]; then +if [ $_UID -ge 500 -o $_UID -eq 0 ] && [ ! -f "$HOME/.ssh/config" -a ! -f "$HOME/.ssh/cluster" ]; then echo "Configuring SSH for cluster access" install -d -m 700 $HOME/.ssh ssh-keygen -t rsa -f $HOME/.ssh/cluster -N '' -C "Warewulf Cluster key" > /dev/null 2>&1