Browse Source

Choice of communication services over mesh

Bob Mottram 9 years ago
parent
commit
d733dcfef8
1 changed files with 35 additions and 5 deletions
  1. 35
    5
      src/freedombone-mesh

+ 35
- 5
src/freedombone-mesh View File

@@ -82,6 +82,8 @@ read peer_index
82 82
 
83 83
 # if no selection made
84 84
 if [ ! $peer_index ]; then
85
+    echo 'Nothing was selected'
86
+    echo ''
85 87
     exit 0
86 88
 fi
87 89
 
@@ -102,16 +104,44 @@ fi
102 104
 
103 105
 # Connect to IRC
104 106
 if [ ! -f /usr/bin/irssi ]; then
105
-    echo 'You need irssi installed on your system'
107
+    if [ -f /usr/bin/mumble ]; then
108
+        mumble &
109
+        exit 0
110
+    fi
111
+    echo 'You need irssi and/or mumble installed on your system'
106 112
     sudo batman stop
107 113
     exit 4
108 114
 fi
109 115
 
110
-# open mumble if it exists
111
-if [ -f /usr/bin/mumble ]; then
112
-    mumble &
116
+if [ ! -f /usr/bin/mumble ]; then
117
+    if [ -f /usr/bin/irssi ]; then
118
+        irssi -c $AVAHI_DOMAIN -p $IRC_PORT -n $USER
119
+        exit 0
120
+    fi
121
+    echo 'You need irssi and/or mumble installed on your system'
122
+    sudo batman stop
123
+    exit 4
113 124
 fi
114
-irssi -c $AVAHI_DOMAIN -p $IRC_PORT -n $USER
115 125
 
126
+echo ''
127
+echo 'Choose communication service:'
128
+echo '    1. VoIP + Instant Messaging'
129
+echo '    2. IRC (WARNING: not encrypted)'
130
+echo ''
131
+
132
+read peer_index
133
+
134
+# if no selection made
135
+if [ ! $peer_index ]; then
136
+    echo 'Nothing was selected'
137
+    echo ''
138
+    exit 0
139
+fi
140
+
141
+if [[ $peer_index == 1 ]]; then
142
+    mumble &
143
+else
144
+    irssi -c $AVAHI_DOMAIN -p $IRC_PORT -n $USER
145
+fi
116 146
 
117 147
 exit 0