netapp 7-mode autologin script (for linux)

#!/bin/bash

#setup autologin
function key {
hostname=`hostname`
ip=`cat /etc/hosts|grep $hostname | cut -f1 -d" "`
echo "setting up autologin to $name for $ip"
echo "provide root-password for $name"
ssh $name exportfs -i -o rw,root=$ip,nosuid /vol/vol0
echo "share done"
cd /net/$name/vol/vol0/etc/
mkdir -p sshd/root/.ssh
if cat $HOME/.ssh/id_dsa.pub > /dev/null 2>&1
then
cat $HOME/.ssh/id_dsa.pub >> sshd/root/.ssh/authorized_keys
else
if cat $HOME/.ssh/id_rsa.pub > /dev/null 2>&1
then
cat $HOME/.ssh/id_rsa.pub >> sshd/root/.ssh/authorized_keys
else
echo "no public keys found"
echo "run ssh-keygen -t rsa or ssh-keygen -t dsa"
echo exiting
exit
fi
fi
}

#main
#gather info
echo "setup autologin for netapp filers 7-mode"

echo -n "filer (name/ip) : "
read name

echo -n "is autologin configured for $name (y/n)? : "
read input
if test $input == "y"
then
:
else
echo -n "do you want to (y/n) ? : "
read input
if test $input == "n"
then
:
else
key
fi
fi

This entry was posted in netapp. Bookmark the permalink.

Comments are closed.