Special Xbian init.d config

This commit is contained in:
qo-op 2020-12-07 16:29:04 +01:00
parent c432c3d3f9
commit 31eb15852c
2 changed files with 13 additions and 6 deletions

View File

@ -82,6 +82,14 @@ sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/ipfs.service
sudo systemctl daemon-reload || err "Restart IPFS"
sudo systemctl enable ipfs || err "Enable IPFS daemon"
## Special Xbian init.d config
if [[ $USER == "xbian" && -f ~/.zen/astroport/.install/templates/ipfs/ipfs-initV.sh ]]; then
sudo cp ~/.zen/astroport/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs
sudo chmod 755 /etc/init.d/ipfs
sudo service ipfs enable
fi
# INIT ipfs
[[ $isLAN ]] && ipfs init -p lowpower \
|| ipfs init -p server

View File

@ -15,13 +15,12 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
DESC="ipfs daemon"
NAME=ipfs
DAEMON=/usr/local/bin/ipfs
DAEMON_ARGS="daemon"
DAEMON_ARGS="daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
IPFS_PATH=/media/data/.ipfs
IPFS_USER=root
IPFS_PATH=/home/xbian/.ipfs
IPFS_USER=xbian
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
@ -48,7 +47,7 @@ do_start() {
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \
--background --chuid $IPFS_USER --no-close \
--exec /usr/bin/env IPFS_PATH="$IPFS_PATH" $DAEMON 2>>$IPFS_PATH/logs/daemon.log 1>/dev/null \
--exec /usr/bin/env IPFS_PATH="$IPFS_PATH" $DAEMON 2>>/var/log/ipfs.log 1>/dev/null \
-- $DAEMON_ARGS \
|| return 2
}
@ -99,4 +98,4 @@ case "$1" in
echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
exit 3
;;
esac
esac