|
@ -1,7 +1,9 @@ |
|
|
#!/bin/sh |
|
|
#!/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
SSHDIR="$HOME/.ssh" |
|
|
|
|
|
|
|
|
keys= |
|
|
keys= |
|
|
for x in $HOME/.ssh/*.pub; do |
|
|
|
|
|
|
|
|
for x in $SSHDIR/*.pub; do |
|
|
if [ -s "$x" ]; then |
|
|
if [ -s "$x" ]; then |
|
|
keys="$keys $x" |
|
|
keys="$keys $x" |
|
|
else |
|
|
else |
|
@ -9,7 +11,7 @@ for x in $HOME/.ssh/*.pub; do |
|
|
fi |
|
|
fi |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
ak="$HOME/.ssh/authorized_keys" |
|
|
|
|
|
|
|
|
ak="$SSHDIR/authorized_keys" |
|
|
if [ -s "$ak" ]; then |
|
|
if [ -s "$ak" ]; then |
|
|
while read l; do |
|
|
while read l; do |
|
|
found= |
|
|
found= |
|
@ -25,7 +27,7 @@ if [ -s "$ak" ]; then |
|
|
if [ -z "$found" ]; then |
|
|
if [ -z "$found" ]; then |
|
|
name="$(echo "$l" | cut -d' ' -f3)" |
|
|
name="$(echo "$l" | cut -d' ' -f3)" |
|
|
if [ -n "$name" ]; then |
|
|
if [ -n "$name" ]; then |
|
|
echo "$l" > .ssh/$name.pub |
|
|
|
|
|
|
|
|
echo "$l" > "$SSHDIR/$name.pub" |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
done < $ak > $ak~ |
|
|
done < $ak > $ak~ |
|
@ -34,7 +36,7 @@ else |
|
|
for x in amery@geeks.cl \ |
|
|
for x in amery@geeks.cl \ |
|
|
amery@builder.geeks.cl \ |
|
|
amery@builder.geeks.cl \ |
|
|
amery@shell.easy-cloud.net; do |
|
|
amery@shell.easy-cloud.net; do |
|
|
x="$HOME/.ssh/$x.pub" |
|
|
|
|
|
|
|
|
x="$SSHDIR/$x.pub" |
|
|
[ -s "$x" ] || continue |
|
|
[ -s "$x" ] || continue |
|
|
cat "$x" |
|
|
cat "$x" |
|
|
done > $ak~ |
|
|
done > $ak~ |
|
|