Skip to content
Snippets Groups Projects
Verified Commit ae4e220b authored by David Beniamine's avatar David Beniamine
Browse files

Send rsa key

parent 7749f894
Branches
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ if [ ! -d $conf_dir ]
then
# Init
mkdir $conf_dir
ssh-keygen -P "" -f /root/.ssh/id_rsa
else
# Clean
while read line
......@@ -49,6 +50,8 @@ do
then
date=$(date +%Y%m%d)
res=$(grep "$line" $conf_file)
rIP=$(echo $line | cut -d ' ' -f 3)
line=$(echo $line | cut -d ' ' -f 1-2)
if [ ! -z "$res" ]
then
# Update
......@@ -57,6 +60,7 @@ do
# Add
echo "$date $line" >> $conf_file
fi
cat /root/.ssh/id_rsa.pub | netcat $rIP $port
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment