#!/bin/sh
IP=$1	
Private_key=$2
#spadm passwd test
ssh -Y  spadm@$IP
if [ $? -eq 0 ] ;then
echo "The setting of spadm's password is wrong. Please check."
fi
#spadm passwd test
ssh -Y  spadm@$IP
if [ $? -eq 0 ] ;then
echo "The setting of spadm's password is wrong. Please check."
fi
#spuser oldpasswd test
ssh -Y  spuser@$IP 
if [ $? -eq 0 ] ;then
echo "The setting of spuser's password is wrong. Please check."
fi
#spuser oldpasswd test
ssh -Y  spuser@$IP 
if [ $? -ne 0 ] ;then
echo "The setting of spuser's password is wrong. Please check."
fi
#private key test
ssh -Y  spadm@$IP  -i $Private_key
if [ $? -ne 0 ] ;then
echo "The Private key is not work. Please check."
fi
ssh -Y  spuser@$IP  -i $Private_key
if [ $? -ne 0 ] ;then
echo "The Private key is not work. Please check."
fi
#hamachi test
echo "Please input the hamachi IP"
read hamachi_IP
ssh -Y spuser@$hamachi_IP -i $Private_key
if [ $? -ne 0 ] ;then
echo "The hamachi is not work. Please check."
fi
