-
-
Save stigkj/6565785 to your computer and use it in GitHub Desktop.
Revisions
-
mitsutaka created this gist
Jul 7, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ #!/bin/sh # # PROVIDE: btsync # REQUIRE: LOGIN DAEMON NETWORKING # KEYWORD: shutdown # # To enable BTSync, add this line to your /etc/rc.conf: # # btsync_enable="YES" # # And optionally these line: # # btsync_user="username" # Default is "root" # btsync_bin="/path/to/btsync" # Default is "/usr/local/sbin/btsync" . /etc/rc.subr name="btsync" rcvar="btsync_enable" load_rc_config $name required_files=$btsync_bin : ${btsync_enable="NO"} : ${btsync_user="root"} : ${btsync_bin="/usr/local/bin/${name}"} HOMEDIR=`getent passwd $btsync_user | cut -d: -f6` echo $HOMEDIR if [ -d $HOMEDIR/.config ]; then command="su -l $btsync_user -c \"$btsync_bin --config $HOMEDIR/.config/btsync/config.json\"" fi echo $command run_rc_command "$1"