first usefull version
This commit is contained in:
parent
61527c7202
commit
7674f0a29c
@ -1 +1,8 @@
|
|||||||
# ipfs_daemon
|
# Install IPFS as Daemon
|
||||||
|
|
||||||
|
used on Debian based Distros
|
||||||
|
|
||||||
|
git clone https://github.com/6543/ipfs_daemon
|
||||||
|
sudo ./setup-ipfs-daemon
|
||||||
|
|
||||||
|
ipfs sores its file on /var/spool/ipfs/.ipfs/
|
||||||
|
4
ipfs.initd
Normal file → Executable file
4
ipfs.initd
Normal file → Executable file
@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
DAEMON=/usr/local/bin/ipfs
|
DAEMON=/usr/local/bin/ipfs
|
||||||
IPFS_UID=1001
|
IPFS_UID=#UID#
|
||||||
IPFS_GID=1001
|
IPFS_GID=#GID
|
||||||
IPFS_PID_FILE=/var/run/ipfs.pid
|
IPFS_PID_FILE=/var/run/ipfs.pid
|
||||||
|
|
||||||
test -x $DAEMON || exit 0
|
test -x $DAEMON || exit 0
|
||||||
|
74
setup-ipfs-daemon
Normal file → Executable file
74
setup-ipfs-daemon
Normal file → Executable file
@ -1,31 +1,71 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Licence GPL 3
|
||||||
|
|
||||||
## daemon user
|
#####################
|
||||||
|
## S e t t i n g s ##
|
||||||
|
#####################
|
||||||
|
|
||||||
#adduser ipfs -nologin -home /var/spool/ipfs/
|
VERSION=0.4.13
|
||||||
#GID=`id -g ipfs`
|
AIM=/usr/local/bin/ipfs
|
||||||
#UID=`id -u ipfs`
|
|
||||||
|
####### ENDE #######
|
||||||
|
|
||||||
|
[ "`id -u`" != "0" ] && { echo run as root; exit 1; }
|
||||||
|
|
||||||
|
#################
|
||||||
|
## daemon user ##
|
||||||
|
#################
|
||||||
|
|
||||||
|
adduser ipfs --disabled-password --disabled-login --home /var/spool/ipfs/ --system
|
||||||
|
|
||||||
|
|
||||||
## init skript
|
#################
|
||||||
|
## init skript ##
|
||||||
|
#################
|
||||||
|
|
||||||
cp ipfs.initd /etc/init.d/ipfs
|
cp ipfs.initd /etc/init.d/ipfs
|
||||||
#sed -i 's/IPFS_GID=1001/IPFS_GID=$GID/g'
|
sed -i "s/#GID#/`id -g ipfs`/g" /etc/init.d/ipfs
|
||||||
#sed -i 's/IPFS_UID=1001/IPFS_UID=$GID/g'
|
sed -i "s/#UID#/`id -u ipfs`/g" /etc/init.d/ipfs
|
||||||
|
chmod +x /etc/init.d/ipfs
|
||||||
update-rc.d ipfs defaults
|
update-rc.d ipfs defaults
|
||||||
|
|
||||||
|
|
||||||
## install ipfs
|
##################
|
||||||
|
## install ipfs ##
|
||||||
|
##################
|
||||||
|
|
||||||
# wget ipfs_go_{arch}_{vers}.tar.gz
|
# creat tmp and enter it
|
||||||
# tar xzf ipfs_go_{arch}_{vers}.tar.gz
|
cd `mktemp -d`
|
||||||
# rm ipfs_go_{arch}_{vers}.tar.gz
|
|
||||||
# ./go-ipfs/install.sh
|
# select CPU architecture
|
||||||
# chmod 770 `whereis -b ipfs | cut -d ":" -f 1`
|
ARCH=`uname -m`
|
||||||
# chown ipfs:ipfs `whereis -b ipfs | cut -d ":" -f 1`
|
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:ipfs $AIM
|
||||||
|
|
||||||
## init ipfs
|
## init ipfs
|
||||||
su ipfs -c "ipfs init"
|
su ipfs -c "ipfs init"
|
||||||
#sed -i 's/127.0.0.1/0.0.0.0/g' /var/spool/ipfs/.ipfs/config
|
sed -i 's/127.0.0.1/0.0.0.0/g' /var/spool/ipfs/.ipfs/config
|
||||||
|
|
||||||
|
#go back and delete temp
|
||||||
service ipfs start
|
cd -
|
||||||
|
rm -r `cd -`
|
||||||
|
Loading…
Reference in New Issue
Block a user