|
@@ -0,0 +1,343 @@
|
|
1
|
+#!/bin/bash
|
|
2
|
+#
|
|
3
|
+# .---. . .
|
|
4
|
+# | | |
|
|
5
|
+# |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
|
|
6
|
+# | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
|
|
7
|
+# ' ' --' --' -' - -' ' ' -' -' -' ' - --'
|
|
8
|
+#
|
|
9
|
+# Freedom in the Cloud
|
|
10
|
+#
|
|
11
|
+# mesh utilities used by the batman and bmx commands
|
|
12
|
+#
|
|
13
|
+# License
|
|
14
|
+# =======
|
|
15
|
+#
|
|
16
|
+# Copyright (C) 2018 Bob Mottram <bob@freedombone.net>
|
|
17
|
+#
|
|
18
|
+# This program is free software: you can redistribute it and/or modify
|
|
19
|
+# it under the terms of the GNU Affero General Public License as published by
|
|
20
|
+# the Free Software Foundation, either version 3 of the License, or
|
|
21
|
+# (at your option) any later version.
|
|
22
|
+#
|
|
23
|
+# This program is distributed in the hope that it will be useful,
|
|
24
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
25
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
26
|
+# GNU Affero General Public License for more details.
|
|
27
|
+#
|
|
28
|
+# You should have received a copy of the GNU Affero General Public License
|
|
29
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
30
|
+
|
|
31
|
+if [[ $1 == "start" ]]; then
|
|
32
|
+ # install avahi
|
|
33
|
+ sed -i "s|#host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf
|
|
34
|
+ sed -i "s|host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf
|
|
35
|
+ sed -i "s|use-ipv4=.*|use-ipv4=yes|g" /etc/avahi/avahi-daemon.conf
|
|
36
|
+ sed -i "s|use-ipv6=.*|use-ipv6=no|g" /etc/avahi/avahi-daemon.conf
|
|
37
|
+ sed -i "s|#disallow-other-stacks=.*|disallow-other-stacks=yes|g" /etc/avahi/avahi-daemon.conf
|
|
38
|
+ sed -i "s|hosts:.*|hosts: files mdns4_minimal dns mdns4 mdns|g" /etc/nsswitch.conf
|
|
39
|
+fi
|
|
40
|
+
|
|
41
|
+# Mesh definition
|
|
42
|
+WIFI_SSID='mesh'
|
|
43
|
+if [ -f $COMPLETION_FILE ]; then
|
|
44
|
+ if grep -q "WIFI_SSID:" $COMPLETION_FILE; then
|
|
45
|
+ WIFI_SSID=$(cat $COMPLETION_FILE | grep "WIFI_SSID:" | awk -F ':' '{print $2}')
|
|
46
|
+ fi
|
|
47
|
+ sed -i "s|WIFI_SSID:.*|WIFI_SSID:${WIFI_SSID}|g" $COMPLETION_FILE
|
|
48
|
+fi
|
|
49
|
+CELLID='any'
|
|
50
|
+
|
|
51
|
+CHANNEL=2
|
|
52
|
+HOTSPOT_CHANNEL=6
|
|
53
|
+if [ -f $COMPLETION_FILE ]; then
|
|
54
|
+ if grep -q "Wifi channel:" $COMPLETION_FILE; then
|
|
55
|
+ CHANNEL=$(cat $COMPLETION_FILE | grep "Wifi channel:" | awk -F ':' '{print $2}')
|
|
56
|
+ fi
|
|
57
|
+ sed -i "s|Wifi channel:.*|Wifi channel:${CHANNEL}|g" $COMPLETION_FILE
|
|
58
|
+fi
|
|
59
|
+
|
|
60
|
+ZERONET_PORT=15441
|
|
61
|
+IPFS_PORT=4001
|
|
62
|
+TOX_PORT=33445
|
|
63
|
+TRACKER_PORT=6969
|
|
64
|
+LIBREVAULT_PORT=42345
|
|
65
|
+TAHOELAFS_PORT=50213
|
|
66
|
+GIT_SSB_PORT=7718
|
|
67
|
+NGINX_GIT_SSB_PORT=7719
|
|
68
|
+
|
|
69
|
+# Ethernet bridge definition (bridged to bat0)
|
|
70
|
+BRIDGE=br-mesh
|
|
71
|
+BRIDGE_HOTSPOT=br-hotspot
|
|
72
|
+IFACE=
|
|
73
|
+IFACE_SECONDARY=
|
|
74
|
+EIFACE=eth0
|
|
75
|
+WLAN_ADAPTORS=$(count_wlan)
|
|
76
|
+
|
|
77
|
+if [ $WLAN_ADAPTORS -eq 0 ]; then
|
|
78
|
+ echo $'No wlan adaptors found'
|
|
79
|
+ exit 0
|
|
80
|
+fi
|
|
81
|
+
|
|
82
|
+function get_ipv4_wlan {
|
|
83
|
+ echo $(ip -o -f inet addr show dev "$IFACE" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
|
|
84
|
+}
|
|
85
|
+
|
|
86
|
+function mesh_hotspot_ip_address {
|
|
87
|
+ echo $(ip -o -f inet addr show dev "${BRIDGE}" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
|
|
88
|
+}
|
|
89
|
+
|
|
90
|
+function global_rate_limit {
|
|
91
|
+ if ! grep -q "tcp_challenge_ack_limit" /etc/sysctl.conf; then
|
|
92
|
+ echo 'net.ipv4.tcp_challenge_ack_limit = 999999999' >> /etc/sysctl.conf
|
|
93
|
+ else
|
|
94
|
+ sed -i 's|net.ipv4.tcp_challenge_ack_limit.*|net.ipv4.tcp_challenge_ack_limit = 999999999|g' /etc/sysctl.conf
|
|
95
|
+ fi
|
|
96
|
+ sysctl -p -q
|
|
97
|
+}
|
|
98
|
+
|
|
99
|
+function assign_peer_address {
|
|
100
|
+ for i in {1..6}; do
|
|
101
|
+ number=$RANDOM
|
|
102
|
+ let "number %= 255"
|
|
103
|
+ octet=$(echo "obase=16;$number" | bc)
|
|
104
|
+ if [ ${#octet} -lt 2 ]; then
|
|
105
|
+ octet="0${octet}"
|
|
106
|
+ fi
|
|
107
|
+ if [ $i -gt 1 ]; then
|
|
108
|
+ echo -n ":"
|
|
109
|
+ fi
|
|
110
|
+ echo -n "${octet}"
|
|
111
|
+ done
|
|
112
|
+}
|
|
113
|
+
|
|
114
|
+function mesh_create_app_downloads_page {
|
|
115
|
+ if [ ! -d /root/$PROJECT_NAME/image_build/mesh_apps ]; then
|
|
116
|
+ return
|
|
117
|
+ fi
|
|
118
|
+ if [ ! -d /var/www/html ]; then
|
|
119
|
+ return
|
|
120
|
+ fi
|
|
121
|
+ # Don't go straight to cryptpad when navigating to the peer's IP address
|
|
122
|
+ if [ -L /etc/nginx/sites-enabled/cryptpad ]; then
|
|
123
|
+ rm /etc/nginx/sites-enabled/cryptpad
|
|
124
|
+ ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
|
|
125
|
+ if [ -d /etc/cryptpad ]; then
|
|
126
|
+ systemctl stop cryptpad
|
|
127
|
+ systemctl disable cryptpad
|
|
128
|
+ fi
|
|
129
|
+ systemctl restart nginx
|
|
130
|
+ fi
|
|
131
|
+ # Don't show the cryptpad icon on the desktop
|
|
132
|
+ if [ -f /home/fbone/Desktop/cryptpad.desktop ]; then
|
|
133
|
+ mv /home/fbone/Desktop/cryptpad.desktop /home/fbone/.cryptpad.desktop
|
|
134
|
+ fi
|
|
135
|
+
|
|
136
|
+ cp /root/$PROJECT_NAME/website/EN/meshindex.html /var/www/html/index.html
|
|
137
|
+ if [ ! -f /var/www/html/ssb.apk ]; then
|
|
138
|
+ cp /root/$PROJECT_NAME/image_build/mesh_apps/ssb.apk /var/www/html/ssb.apk
|
|
139
|
+ fi
|
|
140
|
+ if [ ! -f /var/www/html/trifa.apk ]; then
|
|
141
|
+ cp /root/$PROJECT_NAME/image_build/mesh_apps/trifa.apk /var/www/html/trifa.apk
|
|
142
|
+ fi
|
|
143
|
+ if [ ! -d /var/www/html/images ]; then
|
|
144
|
+ mkdir /var/www/html/images
|
|
145
|
+ fi
|
|
146
|
+ if [ ! -f /var/www/html/images/logo.png ]; then
|
|
147
|
+ cp /root/$PROJECT_NAME/img/logo.png /var/www/html/images/logo.png
|
|
148
|
+ fi
|
|
149
|
+ if [ ! -f /var/www/html/images/ssb.png ]; then
|
|
150
|
+ cp /root/$PROJECT_NAME/img/icon_patchwork.png /var/www/html/images/ssb.png
|
|
151
|
+ fi
|
|
152
|
+ if [ ! -f /var/www/html/images/trifa.png ]; then
|
|
153
|
+ cp /root/$PROJECT_NAME/img/trifa.png /var/www/html/images/trifa.png
|
|
154
|
+ fi
|
|
155
|
+ if [ ! -f /var/www/html/freedombone.css ]; then
|
|
156
|
+ cp /root/$PROJECT_NAME/website/freedombone.css /var/www/html/freedombone.css
|
|
157
|
+ fi
|
|
158
|
+ chown -R www-data:www-data /var/www/html/*
|
|
159
|
+}
|
|
160
|
+
|
|
161
|
+function enable_mesh_firewall {
|
|
162
|
+ iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
|
|
163
|
+ iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
|
|
164
|
+ iptables -A INPUT -p tcp --dport $TRACKER_PORT -j ACCEPT
|
|
165
|
+ iptables -A INPUT -p udp --dport $TRACKER_PORT -j ACCEPT
|
|
166
|
+ iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
|
167
|
+ iptables -A INPUT -p udp --dport 80 -j ACCEPT
|
|
168
|
+ iptables -A INPUT -p tcp --dport 548 -j ACCEPT
|
|
169
|
+ iptables -A INPUT -p udp --dport 548 -j ACCEPT
|
|
170
|
+ iptables -A INPUT -p tcp --dport 5353 -j ACCEPT
|
|
171
|
+ iptables -A INPUT -p udp --dport 5353 -j ACCEPT
|
|
172
|
+ iptables -A INPUT -p tcp --dport 5354 -j ACCEPT
|
|
173
|
+ iptables -A INPUT -p udp --dport 5354 -j ACCEPT
|
|
174
|
+ iptables -A INPUT -p tcp --dport $ZERONET_PORT -j ACCEPT
|
|
175
|
+ iptables -A INPUT -p udp --dport $ZERONET_PORT -j ACCEPT
|
|
176
|
+ iptables -A INPUT -p tcp --dport $IPFS_PORT -j ACCEPT
|
|
177
|
+ iptables -A INPUT -p tcp --dport $TOX_PORT -j ACCEPT
|
|
178
|
+ iptables -A INPUT -p udp --dport $TOX_PORT -j ACCEPT
|
|
179
|
+ iptables -A INPUT -p tcp --dport $LIBREVAULT_PORT -j ACCEPT
|
|
180
|
+ iptables -A INPUT -p udp --dport $LIBREVAULT_PORT -j ACCEPT
|
|
181
|
+ iptables -A INPUT -p tcp --dport $TAHOELAFS_PORT -j ACCEPT
|
|
182
|
+ # SSB/Scuttlebot/Patchwork
|
|
183
|
+ iptables -A INPUT -p tcp --dport $GIT_SSB_PORT -j ACCEPT
|
|
184
|
+ iptables -A INPUT -p udp --dport 8008 -j ACCEPT
|
|
185
|
+ iptables -A INPUT -p tcp --dport 8008 -j ACCEPT
|
|
186
|
+ iptables -A INPUT -p udp --dport 8010 -j ACCEPT
|
|
187
|
+ iptables -A INPUT -p tcp --dport 8010 -j ACCEPT
|
|
188
|
+ # vpn over the internet
|
|
189
|
+ # Note: the vpn firewall settings are needed in order for Patchwork
|
|
190
|
+ # to discover local peers
|
|
191
|
+ iptables -A INPUT -p tcp --dport 653 -j ACCEPT
|
|
192
|
+ iptables -A INPUT -p udp --dport 653 -j ACCEPT
|
|
193
|
+ iptables -A INPUT -i ${EIFACE} -m state --state NEW -p tcp --dport 1194 -j ACCEPT
|
|
194
|
+ iptables -A INPUT -i tun+ -j ACCEPT
|
|
195
|
+ iptables -A FORWARD -i tun+ -j ACCEPT
|
|
196
|
+ iptables -A FORWARD -i tun+ -o ${EIFACE} -m state --state RELATED,ESTABLISHED -j ACCEPT
|
|
197
|
+ iptables -A FORWARD -i ${EIFACE} -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
|
|
198
|
+ iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ${EIFACE} -j MASQUERADE
|
|
199
|
+ iptables -A OUTPUT -o tun+ -j ACCEPT
|
|
200
|
+ echo 1 > /proc/sys/net/ipv4/ip_forward
|
|
201
|
+ sed -i 's|# net.ipv4.ip_forward|net.ipv4.ip_forward|g' /etc/sysctl.conf
|
|
202
|
+ sed -i 's|#net.ipv4.ip_forward|net.ipv4.ip_forward|g' /etc/sysctl.conf
|
|
203
|
+ sed -i 's|net.ipv4.ip_forward.*|net.ipv4.ip_forward=1|g' /etc/sysctl.conf
|
|
204
|
+}
|
|
205
|
+
|
|
206
|
+function disable_mesh_firewall {
|
|
207
|
+ iptables -D INPUT -p tcp --dport $TRACKER_PORT -j ACCEPT
|
|
208
|
+ iptables -D INPUT -p udp --dport $TRACKER_PORT -j ACCEPT
|
|
209
|
+ iptables -D INPUT -p tcp --dport 80 -j ACCEPT
|
|
210
|
+ iptables -D INPUT -p udp --dport 80 -j ACCEPT
|
|
211
|
+ iptables -D INPUT -p tcp --dport 548 -j ACCEPT
|
|
212
|
+ iptables -D INPUT -p udp --dport 548 -j ACCEPT
|
|
213
|
+ iptables -D INPUT -p tcp --dport 5353 -j ACCEPT
|
|
214
|
+ iptables -D INPUT -p udp --dport 5353 -j ACCEPT
|
|
215
|
+ iptables -D INPUT -p tcp --dport 5354 -j ACCEPT
|
|
216
|
+ iptables -D INPUT -p udp --dport 5354 -j ACCEPT
|
|
217
|
+ iptables -D INPUT -p tcp --dport $ZERONET_PORT -j ACCEPT
|
|
218
|
+ iptables -D INPUT -p udp --dport $ZERONET_PORT -j ACCEPT
|
|
219
|
+ iptables -D INPUT -p tcp --dport $IPFS_PORT -j ACCEPT
|
|
220
|
+ iptables -D INPUT -p udp --dport $IPFS_PORT -j ACCEPT
|
|
221
|
+ iptables -D INPUT -p tcp --dport $TOX_PORT -j ACCEPT
|
|
222
|
+ iptables -D INPUT -p udp --dport $TOX_PORT -j ACCEPT
|
|
223
|
+ iptables -D INPUT -p tcp --dport $LIBREVAULT_PORT -j ACCEPT
|
|
224
|
+ iptables -D INPUT -p udp --dport $LIBREVAULT_PORT -j ACCEPT
|
|
225
|
+ iptables -D INPUT -p tcp --dport $TAHOELAFS_PORT -j ACCEPT
|
|
226
|
+ # SSB/Scuttlebot/Patchwork
|
|
227
|
+ iptables -D INPUT -p tcp --dport $GIT_SSB_PORT -j ACCEPT
|
|
228
|
+ iptables -D INPUT -p udp --dport 8008 -j ACCEPT
|
|
229
|
+ iptables -D INPUT -p tcp --dport 8008 -j ACCEPT
|
|
230
|
+ iptables -D INPUT -p udp --dport 8010 -j ACCEPT
|
|
231
|
+ iptables -D INPUT -p tcp --dport 8010 -j ACCEPT
|
|
232
|
+ # vpn over the internet
|
|
233
|
+ iptables -D INPUT -p tcp --dport 653 -j ACCEPT
|
|
234
|
+ iptables -D INPUT -p udp --dport 653 -j ACCEPT
|
|
235
|
+ iptables -D INPUT -i ${EIFACE} -m state --state NEW -p tcp --dport 1194 -j ACCEPT
|
|
236
|
+ iptables -D INPUT -i tun+ -j ACCEPT
|
|
237
|
+ iptables -D FORWARD -i tun+ -j ACCEPT
|
|
238
|
+ iptables -D FORWARD -i tun+ -o ${EIFACE} -m state --state RELATED,ESTABLISHED -j ACCEPT
|
|
239
|
+ iptables -D FORWARD -i ${EIFACE} -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
|
|
240
|
+ iptables -t nat -D POSTROUTING -s 10.8.0.0/24 -o ${EIFACE} -j MASQUERADE
|
|
241
|
+ iptables -D OUTPUT -o tun+ -j ACCEPT
|
|
242
|
+
|
|
243
|
+ echo 0 > /proc/sys/net/ipv4/ip_forward
|
|
244
|
+ sed -i 's|net.ipv4.ip_forward=.*|net.ipv4.ip_forward=0|g' /etc/sysctl.conf
|
|
245
|
+}
|
|
246
|
+
|
|
247
|
+function enable_mesh_scuttlebot {
|
|
248
|
+ if [ -f /etc/scuttlebot/.ssb/config ]; then
|
|
249
|
+ ethernet_connected=$(cat /sys/class/net/eth0/carrier)
|
|
250
|
+ if [[ "$ethernet_connected" != "0" ]]; then
|
|
251
|
+ sed -i "s|\"host\": .*|\"host\": \"$(get_ipv4_wlan)\",|g" /etc/scuttlebot/.ssb/config
|
|
252
|
+ systemctl restart scuttlebot
|
|
253
|
+ else
|
|
254
|
+ if [ ! -f /etc/nginx/sites-available/git_ssb ]; then
|
|
255
|
+ systemctl stop scuttlebot
|
|
256
|
+ else
|
|
257
|
+ systemctl restart scuttlebot
|
|
258
|
+ fi
|
|
259
|
+ fi
|
|
260
|
+ fi
|
|
261
|
+ sed -i "s|\"host\":.*|\"host\": \"${HOSTNAME}.local\",|g" /etc/scuttlebot/.ssb/config
|
|
262
|
+ systemctl restart scuttlebot
|
|
263
|
+}
|
|
264
|
+
|
|
265
|
+function enable_mesh_tor {
|
|
266
|
+ # if we have an ethernet connection to an internet router then create
|
|
267
|
+ # an onion address for this peer
|
|
268
|
+ if [[ "$ethernet_connected" != "0" ]]; then
|
|
269
|
+ systemctl enable tor
|
|
270
|
+ systemctl start tor
|
|
271
|
+ HIDDEN_SERVICE_PATH=/var/lib/tor/hidden_service_
|
|
272
|
+ if [ ! -f ${HIDDEN_SERVICE_PATH}mesh/hostname ]; then
|
|
273
|
+ echo "HiddenServiceDir ${HIDDEN_SERVICE_PATH}mesh/" >> /etc/tor/torrc
|
|
274
|
+ echo "HiddenServicePort 653 127.0.0.1:653" >> /etc/tor/torrc
|
|
275
|
+ systemctl restart tor
|
|
276
|
+ fi
|
|
277
|
+ else
|
|
278
|
+ systemctl stop tor
|
|
279
|
+ systemctl disable tor
|
|
280
|
+ fi
|
|
281
|
+}
|
|
282
|
+
|
|
283
|
+function enable_mesh_seconary_wifi {
|
|
284
|
+ if [ $secondary_wifi_available ]; then
|
|
285
|
+ sed -i 's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g' /etc/default/hostapd
|
|
286
|
+
|
|
287
|
+ mesh_hotspot_address=$(mesh_hotspot_ip_address)
|
|
288
|
+ if [[ "$mesh_hotspot_address" == *'.'* ]]; then
|
|
289
|
+ echo "interface=${IFACE_SECONDARY}" > /etc/hostapd/hostapd.conf
|
|
290
|
+ echo "bridge=${BRIDGE}" >> /etc/hostapd/hostapd.conf
|
|
291
|
+ echo 'driver=nl80211' >> /etc/hostapd/hostapd.conf
|
|
292
|
+ echo "country_code=UK" >> /etc/hostapd/hostapd.conf
|
|
293
|
+ echo "ssid=${WIFI_SSID}-${mesh_hotspot_address}" >> /etc/hostapd/hostapd.conf
|
|
294
|
+ echo 'hw_mode=g' >> /etc/hostapd/hostapd.conf
|
|
295
|
+ echo "channel=${HOTSPOT_CHANNEL}" >> /etc/hostapd/hostapd.conf
|
|
296
|
+ echo 'wpa=2' >> /etc/hostapd/hostapd.conf
|
|
297
|
+ echo "wpa_passphrase=$HOTSPOT_PASSPHRASE" >> /etc/hostapd/hostapd.conf
|
|
298
|
+ echo 'wpa_key_mgmt=WPA-PSK' >> /etc/hostapd/hostapd.conf
|
|
299
|
+ echo 'wpa_pairwise=TKIP' >> /etc/hostapd/hostapd.conf
|
|
300
|
+ echo 'rsn_pairwise=CCMP' >> /etc/hostapd/hostapd.conf
|
|
301
|
+ echo 'auth_algs=1' >> /etc/hostapd/hostapd.conf
|
|
302
|
+ echo 'macaddr_acl=0' >> /etc/hostapd/hostapd.conf
|
|
303
|
+
|
|
304
|
+ sed -i "s|#interface=.*|interface=${IFACE_SECONDARY}|g" /etc/dnsmasq.conf
|
|
305
|
+ sed -i "s|interface=.*|interface=${IFACE_SECONDARY}|g" /etc/dnsmasq.conf
|
|
306
|
+ sed -i "s|listen-address=.*|listen-address=127.0.0.1,$mesh_hotspot_address|g" /etc/dnsmasq.conf
|
|
307
|
+ sed -i 's|#listen-address|listen-address|g' /etc/dnsmasq.conf
|
|
308
|
+ systemctl enable dnsmasq
|
|
309
|
+ systemctl restart dnsmasq
|
|
310
|
+
|
|
311
|
+ systemctl enable hostapd
|
|
312
|
+ systemctl restart hostapd
|
|
313
|
+ mesh_create_app_downloads_page
|
|
314
|
+ else
|
|
315
|
+ secondary_wifi_available=
|
|
316
|
+ echo $'WARNING: No IP address could be obtained for the hotspot'
|
|
317
|
+ fi
|
|
318
|
+ fi
|
|
319
|
+
|
|
320
|
+ if [ ! $secondary_wifi_available ]; then
|
|
321
|
+ systemctl stop hostapd
|
|
322
|
+ systemctl disable hostapd
|
|
323
|
+
|
|
324
|
+ # Recreate the cryptpad symlink
|
|
325
|
+ if [ -f /etc/nginx/sites-available/cryptpad ]; then
|
|
326
|
+ if [ -L /etc/nginx/sites-enabled/cryptpad ]; then
|
|
327
|
+ rm /etc/nginx/sites-enabled/default
|
|
328
|
+ fi
|
|
329
|
+ systemctl enable cryptpad
|
|
330
|
+ systemctl start cryptpad
|
|
331
|
+
|
|
332
|
+ if [ ! -L /etc/nginx/sites-enabled/cryptpad ]; then
|
|
333
|
+ ln -s /etc/nginx/sites-available/cryptpad /etc/nginx/sites-enabled/cryptpad
|
|
334
|
+ systemctl restart nginx
|
|
335
|
+ fi
|
|
336
|
+ fi
|
|
337
|
+ if [ -f /home/fbone/.cryptpad.desktop ]; then
|
|
338
|
+ mv /home/fbone/.cryptpad.desktop /home/fbone/Desktop/cryptpad.desktop
|
|
339
|
+ fi
|
|
340
|
+ fi
|
|
341
|
+}
|
|
342
|
+
|
|
343
|
+# NOTE: deliberately there is no "exit 0"
|