Merge pull request #538 from wesley800/development

remove exit from ssh_setup.*sh
This commit is contained in:
Christian Goll
2022-09-20 11:02:50 +02:00
committed by GitHub
3 changed files with 3 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ func CopyFile(src string, dst string) error {
return err
}
dstFD, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE, srcInfo.Mode())
dstFD, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, srcInfo.Mode())
if err != nil {
wwlog.Error("Could not create destination file %s: %s\n", dst, err)
return err

View File

@@ -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

View File

@@ -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