home *** CD-ROM | disk | FTP | other *** search
Wrap
#!/bin/sh #frontend for ssh, secure telnet. #(c) Barry Kauler 2004 www.goosee.com/puppy . /etc/securetelnetrc HDRMSG="#Configuration file for secure telnet. See Network menu." while [ 1 ] do RETSTR=`Xdialog --wmclass "securetelnet" --title "Secure telnet" --stdout --left --separator "|" --help "" --3inputsbox "ssh can be used for secure remote login,\ninvoked with the format:\n ssh -l username -p port hostname\nI suggest try port 22, if not known." 0 0 "Hostname:" "$SSHHOSTNAME" "Port:" "$SSHPORT" "Username:" "$SSHUSERNAME"` RETVAL=$? case $RETVAL in 0) #ok RETHOSTNAME=`echo -n "$RETSTR" | cut -f 1 -d "|"` RETPORT=`echo -n "$RETSTR" | cut -f 2 -d "|"` RETUSERNAME=`echo -n "$RETSTR" | cut -f 3 -d "|"` echo "$HDRMSG" > /etc/securetelnetrc echo "SSHHOSTNAME=\"${RETHOSTNAME}\"" >> /etc/securetelnetrc echo "SSHPORT=\"${RETPORT}\"" >> /etc/securetelnetrc echo "SSHUSERNAME=\"${RETUSERNAME}\"" >> /etc/securetelnetrc echo '#!/bin/sh' > /tmp/runssh.sh echo -e "ssh -l $RETUSERNAME -p $RETPORT $RETHOSTNAME 2>/tmp/scratch1.txt" >> /tmp/runssh.sh echo 'if [ ! $? -eq 0 ];then' >> /tmp/runssh.sh echo -e "ERRSTR=\"\`cat /tmp/scratch1.txt\`\"" >> /tmp/runssh.sh echo -en "Xdialog --wmclass \"securetelnet\" --title \"Secure telnet\" --infobox \"Failed to execute:" >> /tmp/runssh.sh echo -n '\n' >> /tmp/runssh.sh echo -n " ssh -l $RETUSERNAME -p $RETPORT $RETHOSTNAME" >> /tmp/runssh.sh echo -n '\n' >> /tmp/runssh.sh echo -n "ssh error message:" >> /tmp/runssh.sh echo -n '\n' >> /tmp/runssh.sh echo '$ERRSTR" 0 0 40000' >> /tmp/runssh.sh echo 'fi' >> /tmp/runssh.sh sync chmod 755 /tmp/runssh.sh rxvt -bg "#ff80e0" -name "securetelnet" -title "Secure telnet" -e "/tmp/runssh.sh" break ;; 1) #cancel break ;; 2) #help dillo file:///usr/share/doc/ssh.htm & ;; *) break ;; esac done