Autostart on boot btsync for arm in NAS using ffp


bigsuraz

Recommended Posts


##FFP Start btsync on nas

# paste this in /ffp/start/btsync.sh

# $ cat btsync.sh

#!/ffp/bin/sh
#copy btsync to /mnt/pools/A/A0/btsync mordify it if needed


# PROVIDE: Transmission

. /ffp/etc/ffp.subr

BT_HOME=/mnt/pools/A/A0/btsync

name="btsync"
command="/mnt/pools/A/A0/btsync/$name"
start_cmd="bt_start"
stop_cmd="bt_stop"
status_cmd="bt_status"
user=root
su_cmd="/ffp/bin/su"

bt_start()
{
if [ ! -d ${BT_HOME} ]; then
$su_cmd $user -c "mkdir ${BT_HOME}"
fi
echo "Starting $name"
$su_cmd $user -c "$command"
}

bt_stop()
{
echo "Stopping $name"
/ffp/bin/killall -SIGINT $name
}

bt_status()
{
_pids=$(pidof $name)
if test -n "$_pids"; then
echo "$name is running, pid:"
pidof $name
else
echo "$name not running"
fi
}

run_rc_command "$1"

#save this file as btsync.sh

#chmod it
# $ chmod a+x /ffp/start/btsync.sh

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.