diff --git a/src/freedombone-mesh b/src/freedombone-mesh index 0a6f517f..13d07cac 100755 --- a/src/freedombone-mesh +++ b/src/freedombone-mesh @@ -82,6 +82,8 @@ read peer_index # if no selection made if [ ! $peer_index ]; then + echo 'Nothing was selected' + echo '' exit 0 fi @@ -102,16 +104,44 @@ fi # Connect to IRC if [ ! -f /usr/bin/irssi ]; then - echo 'You need irssi installed on your system' + if [ -f /usr/bin/mumble ]; then + mumble & + exit 0 + fi + echo 'You need irssi and/or mumble installed on your system' sudo batman stop exit 4 fi -# open mumble if it exists -if [ -f /usr/bin/mumble ]; then - mumble & +if [ ! -f /usr/bin/mumble ]; then + if [ -f /usr/bin/irssi ]; then + irssi -c $AVAHI_DOMAIN -p $IRC_PORT -n $USER + exit 0 + fi + echo 'You need irssi and/or mumble installed on your system' + sudo batman stop + exit 4 fi -irssi -c $AVAHI_DOMAIN -p $IRC_PORT -n $USER +echo '' +echo 'Choose communication service:' +echo ' 1. VoIP + Instant Messaging' +echo ' 2. IRC (WARNING: not encrypted)' +echo '' + +read peer_index + +# if no selection made +if [ ! $peer_index ]; then + echo 'Nothing was selected' + echo '' + exit 0 +fi + +if [[ $peer_index == 1 ]]; then + mumble & +else + irssi -c $AVAHI_DOMAIN -p $IRC_PORT -n $USER +fi exit 0