i2p utilities

This commit is contained in:
Bob Mottram 2018-02-11 13:44:17 +00:00
parent a8f6cd320f
commit 1e687aa54f
1 changed files with 62 additions and 0 deletions

62
src/freedombone-utils-i2p Executable file
View File

@ -0,0 +1,62 @@
#!/bin/bash
#
# .---. . .
# | | |
# |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
# | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
# ' ' --' --' -' - -' ' ' -' -' -' ' - --'
#
# Freedom in the Cloud
#
# i2p functions
#
# There's a problem with installing this onto mesh images, which is
# that qemu appears to run out of RAM when using yarn to add webpack.
#
# License
# =======
#
# Copyright (C) 2017-2018 Bob Mottram <bob@freedombone.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
I2P_DOMAIN='deb.i2p2.de'
function install_i2p {
if [ ! -d $INSTALL_DIR ]; then
mkdir -p $INSTALL_DIR
fi
# install the gpg key
cd $INSTALL_DIR
if [ -f i2p-debian-repo.key.asc ]; then
rm i2p-debian-repo.key.asc
fi
wget https://geti2p.net/_static/i2p-debian-repo.key.asc
if [ ! -f i2p-debian-repo.key.asc ]; then
echo $'failed to ontain i2p repo gpg key'
exit 7834627345
fi
apt-key add i2p-debian-repo.key.asc
echo "deb https://${I2P_DOMAIN}/ stretch main" > /etc/apt/sources.list.d/i2p.list
echo "deb-src https://${I2P_DOMAIN}/ stretch main" >> /etc/apt/sources.list.d/i2p.list
apt-get update
apt-get -yq install i2p i2p-keyring
}
function remove_i2p {
apt-get -yq remove i2p i2p-keyring --purge
}