forked from axiom-team/astrXbian
xbian OR debian INSTALL ready
This commit is contained in:
parent
370548bd04
commit
b40fdbe8f7
|
@ -58,18 +58,41 @@ cd $MY_PATH
|
|||
echo "INSTALL ipfs 0.7.0 >>>>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
sudo ipfs-update install 0.7.0 || err "Install IPFS"
|
||||
|
||||
## Special Xbian init.d config
|
||||
if [[ -f ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh ]]; then
|
||||
sudo cp ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs
|
||||
sudo chmod 755 /etc/init.d/ipfs
|
||||
sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log
|
||||
fi
|
||||
|
||||
|
||||
# INIT ipfs
|
||||
[[ $isLAN ]] && ipfs init -p lowpower \
|
||||
|| ipfs init -p server
|
||||
|
||||
## Special Xbian init.d config
|
||||
if [[ "$USER" == "xbian" ]]; then
|
||||
sudo cp ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs
|
||||
sudo chmod 755 /etc/init.d/ipfs
|
||||
sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log
|
||||
else
|
||||
## DEBIAN
|
||||
echo "CREATE SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>>>>"
|
||||
cat > /tmp/ipfs.service <<EOF
|
||||
[Unit]
|
||||
Description=IPFS daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=_USER_
|
||||
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo cp -f /tmp/ipfs.service /etc/systemd/system/
|
||||
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/ipfs.service
|
||||
|
||||
[[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ipfs
|
||||
fi
|
||||
|
||||
|
||||
###########################################
|
||||
# ACTIVATE IPFS OPTIONS: #swarm0 INIT
|
||||
###########################################
|
||||
|
@ -97,5 +120,8 @@ ipfs bootstrap add /ip6/fe80::208:a2ff:fe0c:20d8/tcp/4001/p2p/12D3KooWBYme2BsNUr
|
|||
# AVOID CONFLICT WITH KODI REMOTE
|
||||
ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181"
|
||||
|
||||
[[ "$USER" != "xbian" ]] && sudo systemctl restart ipfs
|
||||
|
||||
|
||||
} # this ensures the entire script is downloaded #
|
||||
# IPFS CONFIG documentation: https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#addressesswarm
|
||||
|
|
Loading…
Reference in New Issue