Browse Source

i2p utilities

Bob Mottram 7 years ago
parent
commit
1e687aa54f
1 changed files with 62 additions and 0 deletions
  1. 62
    0
      src/freedombone-utils-i2p

+ 62
- 0
src/freedombone-utils-i2p View File

@@ -0,0 +1,62 @@
1
+#!/bin/bash
2
+#
3
+# .---.                  .              .
4
+# |                      |              |
5
+# |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
6
+# |    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-'
7
+# '    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'
8
+#
9
+#                    Freedom in the Cloud
10
+#
11
+# i2p functions
12
+#
13
+# There's a problem with installing this onto mesh images, which is
14
+# that qemu appears to run out of RAM when using yarn to add webpack.
15
+#
16
+# License
17
+# =======
18
+#
19
+# Copyright (C) 2017-2018 Bob Mottram <bob@freedombone.net>
20
+#
21
+# This program is free software: you can redistribute it and/or modify
22
+# it under the terms of the GNU Affero General Public License as published by
23
+# the Free Software Foundation, either version 3 of the License, or
24
+# (at your option) any later version.
25
+#
26
+# This program is distributed in the hope that it will be useful,
27
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
28
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29
+# GNU Affero General Public License for more details.
30
+#
31
+# You should have received a copy of the GNU Affero General Public License
32
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
33
+
34
+I2P_DOMAIN='deb.i2p2.de'
35
+
36
+function install_i2p {
37
+    if [ ! -d $INSTALL_DIR ]; then
38
+       mkdir -p $INSTALL_DIR
39
+    fi
40
+
41
+    # install the gpg key
42
+    cd $INSTALL_DIR
43
+    if [ -f i2p-debian-repo.key.asc ]; then
44
+        rm i2p-debian-repo.key.asc
45
+    fi
46
+    wget https://geti2p.net/_static/i2p-debian-repo.key.asc
47
+    if [ ! -f i2p-debian-repo.key.asc ]; then
48
+        echo $'failed to ontain i2p repo gpg key'
49
+        exit 7834627345
50
+    fi
51
+    apt-key add i2p-debian-repo.key.asc
52
+
53
+    echo "deb https://${I2P_DOMAIN}/ stretch main" > /etc/apt/sources.list.d/i2p.list
54
+    echo "deb-src https://${I2P_DOMAIN}/ stretch main" >> /etc/apt/sources.list.d/i2p.list
55
+
56
+    apt-get update
57
+    apt-get -yq install i2p i2p-keyring
58
+}
59
+
60
+function remove_i2p {
61
+    apt-get -yq remove i2p i2p-keyring --purge
62
+}