From 90f26f6f7e7f040deb33d9e767770c608980c2c6 Mon Sep 17 00:00:00 2001 From: 6543 Date: Sat, 14 Apr 2018 19:18:36 +0200 Subject: [PATCH] only purge should remove the data --- remove | 2 +- setup-ipfs-daemon | 77 ----------------------------------------------- 2 files changed, 1 insertion(+), 78 deletions(-) delete mode 100755 setup-ipfs-daemon diff --git a/remove b/remove index 86ea8aa..bb7262a 100755 --- a/remove +++ b/remove @@ -15,7 +15,7 @@ [ -f "$DAEMON" ] && rm "$DAEMON" [ -f "$IPFS_PID_FILE" ] && rm "$DAEMON" - sudo deluser $IPFS_User --remove-home + sudo deluser $IPFS_User update-rc.d -f ipfs remove rm /etc/init.d/ipfs diff --git a/setup-ipfs-daemon b/setup-ipfs-daemon deleted file mode 100755 index c0dc10b..0000000 --- a/setup-ipfs-daemon +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# Licence GPL 3 - -##################### -## S e t t i n g s ## -##################### - -VERSION=0.4.13 -AIM=/usr/local/bin/ipfs -DATA_DIR=/var/spool/ipfs/ - -####### ENDE ####### - -[ "`id -u`" != "0" ] && { echo run as root; exit 1; } - -################# -## daemon user ## -################# - -adduser ipfs --disabled-password --disabled-login --home $DATA_DIR --system - - -################# -## init skript ## -################# - -cp ipfs.initd /etc/init.d/ipfs -sed -i "s/#GID#/`id -g ipfs`/g" /etc/init.d/ipfs -sed -i "s/#UID#/`id -u ipfs`/g" /etc/init.d/ipfs -sed -i 's|#DATA#|'${DATA_DIR}'|g' /etc/init.d/ipfs -sed -i 's|#AIM#|'${AIM}'|g' /etc/init.d/ipfs -chmod +x /etc/init.d/ipfs -update-rc.d ipfs defaults - - -################## -## install ipfs ## -################## - -# creat tmp and enter it -cd `mktemp -d` - -# select CPU architecture -ARCH=`uname -m` -case "$ARCH" in - i?86) ARCH=386 ;; - x86_64) ARCH="amd64" ;; - *arm*) ARCH="arm" ;; - *) echo ipfs for $arch not available; exit 1 ;; -esac - -#download ... -wget "https://dist.ipfs.io/go-ipfs/v"$VERSION"/go-ipfs_v"$VERSION"_linux-"$ARCH".tar.gz" - -#extract -tar xzf go-ipfs_* - -#delete old one if exit -[ -f $AIM ] && rm $AIM - -# install new -cp go-ipfs/ipfs $AIM - -#set permissions -chmod 770 $AIM -chown ipfs $AIM - -## init ipfs -export "IPFS_PATH=$DATA_DIR" -export "HOME=$DATA_DIR" -sudo -E -u ipfs ipfs init --profile=server -#If you're not running ipfs in a hosted environment, use ipfs init" -sed -i 's/127.0.0.1/0.0.0.0/g' $DATA_DIR/config - -#go back and delete temp -cd - -rm -r `cd -`