add data variable

This commit is contained in:
6543 2018-02-25 16:23:17 +01:00
parent 3be7181f0f
commit 6a9fe3a833
2 changed files with 7 additions and 2 deletions

View File

@ -12,14 +12,16 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/ipfs
IPFS_UID=#UID#
IPFS_GID=#GID
IPFS_GID=#GID#
IPFS_PID_FILE=/var/run/ipfs.pid
IPFS_DATA=#DATA#

test -x $DAEMON || exit 0
. /lib/lsb/init-functions


ipfs_start() {
export "HOME=$IPFS_DATA"
if start-stop-daemon --start --quiet --background \
--pidfile $IPFS_PID_FILE --make-pidfile \
--chuid $IPFS_UID:$IPFS_GID --exec $DAEMON -- daemon

View File

@ -7,6 +7,7 @@

VERSION=0.4.13
AIM=/usr/local/bin/ipfs
DATA_DIR=/var/spool/ipfs/

####### ENDE #######

@ -16,7 +17,7 @@ AIM=/usr/local/bin/ipfs
## daemon user ##
#################

adduser ipfs --disabled-password --disabled-login --home /var/spool/ipfs/ --system
adduser ipfs --disabled-password --disabled-login --home $DATA_DIR --system


#################
@ -26,6 +27,7 @@ adduser ipfs --disabled-password --disabled-login --home /var/spool/ipfs/ --syst
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
chmod +x /etc/init.d/ipfs
update-rc.d ipfs defaults

@ -63,6 +65,7 @@ chmod 770 $AIM
chown ipfs:ipfs $AIM

## init ipfs
export "HOME=$DATA_DIR"
su ipfs -c "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' /var/spool/ipfs/.ipfs/config