Browse Source

Remove removal tests

Bob Mottram 8 years ago
parent
commit
fe35c30d91

+ 0
- 4
src/freedombone-app-babel View File

69
 }
69
 }
70
 
70
 
71
 function remove_babel {
71
 function remove_babel {
72
-    if [[ $(app_is_installed babel) == "0" ]]; then
73
-        return
74
-    fi
75
-
76
     ${PROJECT_NAME}-mesh-install -f babel --remove yes
72
     ${PROJECT_NAME}-mesh-install -f babel --remove yes
77
     if [ ! "$?" = "0" ]; then
73
     if [ ! "$?" = "0" ]; then
78
         echo $'Failed to remove babel'
74
         echo $'Failed to remove babel'

+ 0
- 4
src/freedombone-app-batman View File

83
 }
83
 }
84
 
84
 
85
 function remove_batman {
85
 function remove_batman {
86
-    if [[ $(app_is_installed batman) == "0" ]]; then
87
-        return
88
-    fi
89
-
90
     ${PROJECT_NAME}-mesh-install -f batman --remove yes
86
     ${PROJECT_NAME}-mesh-install -f batman --remove yes
91
     if [ ! "$?" = "0" ]; then
87
     if [ ! "$?" = "0" ]; then
92
         echo $'Failed to remove batman'
88
         echo $'Failed to remove batman'

+ 0
- 3
src/freedombone-app-blog View File

330
 }
330
 }
331
 
331
 
332
 function remove_blog {
332
 function remove_blog {
333
-    if [[ $(app_is_installed blog) == "0" ]]; then
334
-        return
335
-    fi
336
     if [ ${#FULLBLOG_DOMAIN_NAME} -eq 0 ]; then
333
     if [ ${#FULLBLOG_DOMAIN_NAME} -eq 0 ]; then
337
         return
334
         return
338
     fi
335
     fi

+ 0
- 3
src/freedombone-app-cjdns View File

182
 }
182
 }
183
 
183
 
184
 function remove_cjdns {
184
 function remove_cjdns {
185
-    if [[ $(app_is_installed cjdns) == "0" ]]; then
186
-        return
187
-    fi
188
     service cjdns stop
185
     service cjdns stop
189
     ip6tables -D nat -D POSTROUTING -o tun0 -j MASQUERADE
186
     ip6tables -D nat -D POSTROUTING -o tun0 -j MASQUERADE
190
     ip6tables -D FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
187
     ip6tables -D FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT

+ 0
- 3
src/freedombone-app-dlna View File

155
 }
155
 }
156
 
156
 
157
 function remove_dlna {
157
 function remove_dlna {
158
-    if [[ $(app_is_installed dlna) == "0" ]]; then
159
-        return
160
-    fi
161
     service minidlna stop
158
     service minidlna stop
162
     apt-get -y remove --purge minidlna
159
     apt-get -y remove --purge minidlna
163
     if [ -f /etc/minidlna.conf ]; then
160
     if [ -f /etc/minidlna.conf ]; then

+ 0
- 3
src/freedombone-app-emacs View File

98
 }
98
 }
99
 
99
 
100
 function remove_emacs {
100
 function remove_emacs {
101
-    if [[ $(app_is_installed emacs) == "0" ]]; then
102
-        return
103
-    fi
104
     apt-get -y remove --purge emacs24
101
     apt-get -y remove --purge emacs24
105
     update-alternatives --set editor /usr/bin/nano
102
     update-alternatives --set editor /usr/bin/nano
106
     sed -i '/install_emacs/d' $COMPLETION_FILE
103
     sed -i '/install_emacs/d' $COMPLETION_FILE

+ 0
- 3
src/freedombone-app-gnusocial View File

348
 }
348
 }
349
 
349
 
350
 function remove_gnusocial {
350
 function remove_gnusocial {
351
-    if [[ $(app_is_installed gnusocial) == "0" ]]; then
352
-        return
353
-    fi
354
     if [ ${#MICROBLOG_DOMAIN_NAME} -eq 0 ]; then
351
     if [ ${#MICROBLOG_DOMAIN_NAME} -eq 0 ]; then
355
         return
352
         return
356
     fi
353
     fi

+ 0
- 4
src/freedombone-app-gogs View File

377
 }
377
 }
378
 
378
 
379
 function remove_gogs {
379
 function remove_gogs {
380
-    if [[ $(app_is_installed gogs) == "0" ]]; then
381
-        return
382
-    fi
383
-
384
     if [ ${#GIT_DOMAIN_NAME} -eq 0 ]; then
380
     if [ ${#GIT_DOMAIN_NAME} -eq 0 ]; then
385
         return
381
         return
386
     fi
382
     fi

+ 0
- 3
src/freedombone-app-hubzilla View File

317
 }
317
 }
318
 
318
 
319
 function remove_hubzilla {
319
 function remove_hubzilla {
320
-    if [[ $(app_is_installed hubzilla) == "0" ]]; then
321
-        return
322
-    fi
323
     if [ ${#HUBZILLA_DOMAIN_NAME} -eq 0 ]; then
320
     if [ ${#HUBZILLA_DOMAIN_NAME} -eq 0 ]; then
324
         return
321
         return
325
     fi
322
     fi

+ 0
- 6
src/freedombone-app-ipfs View File

157
 }
157
 }
158
 
158
 
159
 function remove_ipfs_go {
159
 function remove_ipfs_go {
160
-    if [[ $(app_is_installed ipfs_go) == "0" ]]; then
161
-        return
162
-    fi
163
     systemctl stop ipfs
160
     systemctl stop ipfs
164
     systemctl disable ipfs
161
     systemctl disable ipfs
165
     systemctl daemon-reload
162
     systemctl daemon-reload
174
 }
171
 }
175
 
172
 
176
 function remove_ipfs_js {
173
 function remove_ipfs_js {
177
-    if [[ $(app_is_installed ipfs_js) == "0" ]]; then
178
-        return
179
-    fi
180
     systemctl stop ipfs
174
     systemctl stop ipfs
181
     systemctl disable ipfs
175
     systemctl disable ipfs
182
     rm /etc/systemd/system/ipfs.service
176
     rm /etc/systemd/system/ipfs.service

+ 0
- 3
src/freedombone-app-irc View File

234
 }
234
 }
235
 
235
 
236
 function remove_irc {
236
 function remove_irc {
237
-    if [[ $(app_is_installed irc) == "0" ]]; then
238
-        return
239
-    fi
240
     remove_watchdog_daemon ngircd
237
     remove_watchdog_daemon ngircd
241
     systemctl stop ngircd
238
     systemctl stop ngircd
242
     apt-get -y remove --purge ngircd
239
     apt-get -y remove --purge ngircd

+ 0
- 3
src/freedombone-app-librevault View File

107
 }
107
 }
108
 
108
 
109
 function remove_librevault {
109
 function remove_librevault {
110
-    if [[ $(app_is_installed librevault) == "0" ]]; then
111
-        return
112
-    fi
113
     iptables -D INPUT -p udp --dport $LIBREVAULT_PORT -j ACCEPT
110
     iptables -D INPUT -p udp --dport $LIBREVAULT_PORT -j ACCEPT
114
     iptables -D INPUT -p tcp --dport $LIBREVAULT_PORT -j ACCEPT
111
     iptables -D INPUT -p tcp --dport $LIBREVAULT_PORT -j ACCEPT
115
     function_check save_firewall_settings
112
     function_check save_firewall_settings

+ 0
- 3
src/freedombone-app-mumble View File

152
 }
152
 }
153
 
153
 
154
 function remove_mumble {
154
 function remove_mumble {
155
-    if [[ $(app_is_installed mumble) == "0" ]]; then
156
-        return
157
-    fi
158
     apt-get -y remove --purge mumble-server
155
     apt-get -y remove --purge mumble-server
159
     if [[ $ONION_ONLY == "no" ]]; then
156
     if [[ $ONION_ONLY == "no" ]]; then
160
         iptables -D INPUT -p udp --dport $MUMBLE_PORT -j ACCEPT
157
         iptables -D INPUT -p udp --dport $MUMBLE_PORT -j ACCEPT

+ 0
- 3
src/freedombone-app-rss View File

244
 }
244
 }
245
 
245
 
246
 function remove_rss {
246
 function remove_rss {
247
-    if [[ $(app_is_installed rss) == "0" ]]; then
248
-        return
249
-    fi
250
     if [ ${#RSS_READER_DOMAIN_NAME} -eq 0 ]; then
247
     if [ ${#RSS_READER_DOMAIN_NAME} -eq 0 ]; then
251
         return
248
         return
252
     fi
249
     fi

+ 0
- 3
src/freedombone-app-searx View File

96
 }
96
 }
97
 
97
 
98
 function remove_searx {
98
 function remove_searx {
99
-    if [[ $(app_is_installed searx) == "0" ]]; then
100
-        return
101
-    fi
102
     systemctl stop searx
99
     systemctl stop searx
103
     systemctl disable searx
100
     systemctl disable searx
104
     rm /etc/systemd/system/searx.service
101
     rm /etc/systemd/system/searx.service

+ 0
- 4
src/freedombone-app-sip View File

155
 }
155
 }
156
 
156
 
157
 function remove_sip {
157
 function remove_sip {
158
-    if [[ $(app_is_installed sip) == "0" ]]; then
159
-        return
160
-    fi
161
-
162
     iptables -D INPUT -p udp --dport $TURN_PORT -j ACCEPT
158
     iptables -D INPUT -p udp --dport $TURN_PORT -j ACCEPT
163
     iptables -D INPUT -p tcp --dport $TURN_PORT -j ACCEPT
159
     iptables -D INPUT -p tcp --dport $TURN_PORT -j ACCEPT
164
     iptables -D INPUT -p tcp --dport $TURN_TLS_PORT -j ACCEPT
160
     iptables -D INPUT -p tcp --dport $TURN_TLS_PORT -j ACCEPT

+ 0
- 3
src/freedombone-app-syncthing View File

460
 }
460
 }
461
 
461
 
462
 function remove_syncthing {
462
 function remove_syncthing {
463
-    if ! grep -Fxq "install_syncthing" $COMPLETION_FILE; then
464
-        return
465
-    fi
466
     iptables -D INPUT -p udp --dport $SYNCTHING_PORT -j ACCEPT
463
     iptables -D INPUT -p udp --dport $SYNCTHING_PORT -j ACCEPT
467
     iptables -D INPUT -p tcp --dport $SYNCTHING_PORT -j ACCEPT
464
     iptables -D INPUT -p tcp --dport $SYNCTHING_PORT -j ACCEPT
468
     function_check save_firewall_settings
465
     function_check save_firewall_settings

+ 0
- 3
src/freedombone-app-tahoelafs View File

183
 }
183
 }
184
 
184
 
185
 function remove_tahoelafs {
185
 function remove_tahoelafs {
186
-    if [[ $(app_is_installed tahoelafs) == "0" ]]; then
187
-        return
188
-    fi
189
     iptables -D INPUT -p udp --dport $TAHOELAFS_PORT -j ACCEPT
186
     iptables -D INPUT -p udp --dport $TAHOELAFS_PORT -j ACCEPT
190
     iptables -D INPUT -p tcp --dport $TAHOELAFS_PORT -j ACCEPT
187
     iptables -D INPUT -p tcp --dport $TAHOELAFS_PORT -j ACCEPT
191
     function_check save_firewall_settings
188
     function_check save_firewall_settings

+ 0
- 11
src/freedombone-app-tox View File

224
 }
224
 }
225
 
225
 
226
 function remove_tox_node {
226
 function remove_tox_node {
227
-    if [[ $(app_is_installed tox_node) == "0" ]]; then
228
-        return
229
-    fi
230
-
231
     iptables -D INPUT -p tcp --dport $TOX_PORT -j ACCEPT
227
     iptables -D INPUT -p tcp --dport $TOX_PORT -j ACCEPT
232
     iptables -D INPUT -p udp --dport $TOX_PORT -j ACCEPT
228
     iptables -D INPUT -p udp --dport $TOX_PORT -j ACCEPT
233
     function_check save_firewall_settings
229
     function_check save_firewall_settings
246
 }
242
 }
247
 
243
 
248
 function remove_tox_avahi {
244
 function remove_tox_avahi {
249
-    if [[ $(app_is_installed tox_avahi) == "0" ]]; then
250
-        return
251
-    fi
252
     cd $INSTALL_DIR/toxid
245
     cd $INSTALL_DIR/toxid
253
     make uninstall
246
     make uninstall
254
     rm -rf $INSTALL_DIR/toxid
247
     rm -rf $INSTALL_DIR/toxid
256
 }
249
 }
257
 
250
 
258
 function remove_tox_client {
251
 function remove_tox_client {
259
-    if [[ $(app_is_installed tox_client) == "0" ]]; then
260
-        return
261
-    fi
262
-
263
     ${PROJECT_NAME}-mesh-install -f tox_client --remove yes
252
     ${PROJECT_NAME}-mesh-install -f tox_client --remove yes
264
     if [ ! "$?" = "0" ]; then
253
     if [ ! "$?" = "0" ]; then
265
         echo $'Could not remove Tox client'
254
         echo $'Could not remove Tox client'

+ 0
- 3
src/freedombone-app-webmail View File

123
 }
123
 }
124
 
124
 
125
 function remove_webmail {
125
 function remove_webmail {
126
-    if [[ $(app_is_installed webmail) == "0" ]]; then
127
-        return
128
-    fi
129
     nginx_dissite webmail
126
     nginx_dissite webmail
130
     if [ -f /etc/nginx/sites-available/webmail ]; then
127
     if [ -f /etc/nginx/sites-available/webmail ]; then
131
         rm /etc/nginx/sites-available/webmail
128
         rm /etc/nginx/sites-available/webmail

+ 0
- 3
src/freedombone-app-wiki View File

210
 }
210
 }
211
 
211
 
212
 function remove_wiki {
212
 function remove_wiki {
213
-    if [[ $(app_is_installed wiki) == "0" ]]; then
214
-        return
215
-    fi
216
     if [ ${#WIKI_DOMAIN_NAME} -eq 0 ]; then
213
     if [ ${#WIKI_DOMAIN_NAME} -eq 0 ]; then
217
         return
214
         return
218
     fi
215
     fi

+ 0
- 6
src/freedombone-app-xmpp View File

261
 }
261
 }
262
 
262
 
263
 function remove_xmpp_client {
263
 function remove_xmpp_client {
264
-    if [[ $(app_is_installed xmpp_client) == "0" ]]; then
265
-        return
266
-    fi
267
     apt-get -y remove --purge profanity
264
     apt-get -y remove --purge profanity
268
     sed '/install_xmpp_client/d' $COMPLETION_FILE
265
     sed '/install_xmpp_client/d' $COMPLETION_FILE
269
 }
266
 }
270
 
267
 
271
 function remove_xmpp {
268
 function remove_xmpp {
272
     remove_xmpp_client
269
     remove_xmpp_client
273
-    if [[ $(app_is_installed xmpp) == "0" ]]; then
274
-        return
275
-    fi
276
     iptables -D INPUT -p tcp --dport 5222:5223 -j ACCEPT
270
     iptables -D INPUT -p tcp --dport 5222:5223 -j ACCEPT
277
     iptables -D INPUT -p tcp --dport 5269 -j ACCEPT
271
     iptables -D INPUT -p tcp --dport 5269 -j ACCEPT
278
     iptables -D INPUT -p tcp --dport 5280:5281 -j ACCEPT
272
     iptables -D INPUT -p tcp --dport 5280:5281 -j ACCEPT

+ 0
- 12
src/freedombone-app-zeronet View File

97
 }
97
 }
98
 
98
 
99
 function remove_zeronet_blog {
99
 function remove_zeronet_blog {
100
-    if [[ $(app_is_installed zeronet_blog) == "0" ]]; then
101
-        return
102
-    fi
103
     if [ -d $MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then
100
     if [ -d $MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then
104
         rm -rf $MESH_INSTALL_DIR/zeronet/ZeroBlog
101
         rm -rf $MESH_INSTALL_DIR/zeronet/ZeroBlog
105
     fi
102
     fi
108
 }
105
 }
109
 
106
 
110
 function remove_zeronet_mail {
107
 function remove_zeronet_mail {
111
-    if [[ $(app_is_installed zeronet_mail) == "0" ]]; then
112
-        return
113
-    fi
114
     if [ -d $MESH_INSTALL_DIR/zeronet/ZeroMail ]; then
108
     if [ -d $MESH_INSTALL_DIR/zeronet/ZeroMail ]; then
115
         rm -rf $MESH_INSTALL_DIR/zeronet/ZeroMail
109
         rm -rf $MESH_INSTALL_DIR/zeronet/ZeroMail
116
     fi
110
     fi
119
 }
113
 }
120
 
114
 
121
 function remove_zeronet_forum {
115
 function remove_zeronet_forum {
122
-    if [[ $(app_is_installed zeronet_forum) == "0" ]]; then
123
-        return
124
-    fi
125
     if [ -d $MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then
116
     if [ -d $MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then
126
         rm -rf $MESH_INSTALL_DIR/zeronet/ZeroTalk
117
         rm -rf $MESH_INSTALL_DIR/zeronet/ZeroTalk
127
     fi
118
     fi
133
     remove_zeronet_blog
124
     remove_zeronet_blog
134
     remove_zeronet_mail
125
     remove_zeronet_mail
135
     remove_zeronet_forum
126
     remove_zeronet_forum
136
-    if [[ $(app_is_installed zeronet) == "0" ]]; then
137
-        return
138
-    fi
139
     iptables -D INPUT -i $WIFI_INTERFACE -p udp --dport $ZERONET_PORT -j ACCEPT
127
     iptables -D INPUT -i $WIFI_INTERFACE -p udp --dport $ZERONET_PORT -j ACCEPT
140
     iptables -D INPUT -i $WIFI_INTERFACE -p tcp --dport $ZERONET_PORT -j ACCEPT
128
     iptables -D INPUT -i $WIFI_INTERFACE -p tcp --dport $ZERONET_PORT -j ACCEPT
141
     iptables -D INPUT -i $WIFI_INTERFACE -p udp --dport $TRACKER_PORT -j ACCEPT
129
     iptables -D INPUT -i $WIFI_INTERFACE -p udp --dport $TRACKER_PORT -j ACCEPT