add env variables

(mv /var/spool/ipfs/.ipfs -> /var/spool/ipfs/)
This commit is contained in:
6543 2018-02-25 17:24:03 +01:00
parent 108af31c60
commit 7789ddd49c
2 changed files with 6 additions and 4 deletions

View File

@ -10,7 +10,7 @@
### END INIT INFO ### END INIT INFO


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=#AIM#
IPFS_UID=#UID# IPFS_UID=#UID#
IPFS_GID=#GID# IPFS_GID=#GID#
IPFS_PID_FILE=/var/run/ipfs.pid IPFS_PID_FILE=/var/run/ipfs.pid
@ -21,7 +21,7 @@ test -x $DAEMON || exit 0




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

View File

@ -28,6 +28,7 @@ cp ipfs.initd /etc/init.d/ipfs
sed -i "s/#GID#/`id -g ipfs`/g" /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/#UID#/`id -u ipfs`/g" /etc/init.d/ipfs
sed -i "s/#DATA#/$DATA_DIR/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 chmod +x /etc/init.d/ipfs
update-rc.d ipfs defaults update-rc.d ipfs defaults


@ -65,10 +66,11 @@ chmod 770 $AIM
chown ipfs $AIM chown ipfs $AIM


## init ipfs ## init ipfs
export "IPFS_PATH=$DATA_DIR"
export "HOME=$DATA_DIR" export "HOME=$DATA_DIR"
su ipfs -c "ipfs init --profile=server" sudo -E -u ipfs ipfs init --profile=server
#If you're not running ipfs in a hosted environment, use ipfs init" #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 sed -i 's/127.0.0.1/0.0.0.0/g' $DATA_DIR/config


#go back and delete temp #go back and delete temp
cd - cd -