remote-support-mambasoft/remote-support-mambasoft.sh.in

14 lines
671 B
Bash
Executable File

#!/bin/bash
[ "$1" ] && LOCAL_PORT=$1 || LOCAL_PORT=22
[ "$2" ] && REMOTE_PORT=$2 || REMOTE_PORT=$(($LOCAL_PORT + 45000))
export SSH_ASKPASS=/usr/bin/ksshaskpass
ssh -p 4424 -N -R $REMOTE_PORT:localhost:$LOCAL_PORT assistenza@services.mambasoft.it
RET=$?
if [ $RET -eq 1 ]; then
kdialog --passivepopup "Disconnected from remote support service." --title "mambaSoft remote support" 10
elif [ $RET -eq 255 -o $RET -eq 137 ]; then
kdialog --passivepopup "Connection to remote support service terminated!" --title "mambaSoft remote support" 10
else
kdialog --passivepopup "Error connecting to remote support service! ($RET)" --title "mambaSoft remote support" 10
fi