Everyone,
im trying to learn bash+zenity
help me by......
posting your favorite bash script (or 2,3, etc).......
preferably ones that use Zenity .......
----- MAKE SURE YOU GIVE US SOME IDEA OF WHAT IT DOES PLEASE!!!--------
remote2someone
this script lets a user
--1 - Make Remote Connection--- via ssh
--2 - display Remote Desktop---- via vncviewer
--3 - Remote X11 tunnel -----------via ssh -X
can be called from command line or from a custom launcher
it opens a new terminal and leaves it open with the connect dialog
until USER exits
thanks fedora-jim
Code:
#!/bin/bash
# Written by wtg_photos
# Edited from fedora-jim's original
#
#
# enter the IP address ofthe remote PC
IPADDRESS="$(zenity --entry --title "Enter IP Address" --text "Enter the IP Address of the remote PC:")"
echo $IPADDRESS
#Enter the username you aregoing to login with
UserName="$(zenity --entry --title "Enter User Name" --text "Enter the User Name to connect with:")"
echo $UserName
# opens a new terminal window and connects to remote PC
function ssh_Remote_PC
{
gnome-terminal -x ssh -L 5911:$IPADDRESS:5901 $UserName@$IPADDRESS
}
function View_Remote_PC
{
gnome-terminal -x vncviewer $IPADDRESS:0
}
function X11_Remote_PC
{
gnome-terminal -x ssh -X $UserName@$IPADDRESS
}
#################################################
selection=
until [ "$selection" = "0" ]; do
echo ""
echo "######################"
echo "1 - Make Remote Connection"
echo "2 - display Remote Desktop"
echo "3 - Remote X11 tunnel"
echo "0 - exit program"
echo ""
echo -n "Enter selection: "
read selection
echo ""
#####################
# Commands executed #
#####################
case $selection in
1 ) $(ssh_Remote_PC) ;;
2 ) $(View_Remote_PC) ;;
3 ) $(X11_Remote_PC) ;;
0 ) exit ;;
* ) echo "Please enter 1, 2, 3 or 0"
esac
done