Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sick-Beard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
Sick-Beard
Commits
75c804b9
Commit
75c804b9
authored
Aug 16, 2011
by
Geoffrey Huntley
Browse files
Options
Downloads
Patches
Plain Diff
Added FreeBSD startup/shutdown (rc.d) config
parent
e0e8f0e7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
init.freebsd
+83
-0
83 additions, 0 deletions
init.freebsd
with
83 additions
and
0 deletions
init.freebsd
0 → 100755
+
83
−
0
View file @
75c804b9
#!/bin/sh
#
# PROVIDE: sickbeard
# REQUIRE: sabnzbd
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# sickbeard_enable (bool): Set to NO by default.
# Set it to YES to enable it.
# sickbeard_user: The user account Sick Beard daemon runs as what
# you want it to be. It uses '_sabnzbd' user by
# default. Do not sets it as empty or it will run
# as root.
# sickbeard_dir: Directory where Sick Beard lives.
# Default: /usr/local/sickbeard
# sickbeard_chdir: Change to this directory before running Sick Beard.
# Default is same as sickbeard_dir.
# sickbeard_pid: The name of the pidfile to create.
# Default is sickbeard.pid in sickbeard_dir.
.
/etc/rc.subr
name
=
"sickbeard"
rcvar
=
${
name
}
_enable
load_rc_config
${
name
}
:
${
sickbeard_enable
:
=
"NO"
}
:
${
sickbeard_user
:
=
"_sabnzbd"
}
:
${
sickbeard_dir
:
=
"/usr/local/sickbeard"
}
:
${
sickbeard_chdir
:
=
"
${
sickbeard_dir
}
"
}
:
${
sickbeard_pid
:
=
"
${
sickbeard_dir
}
/sickbeard.pid"
}
WGET
=
"/usr/local/bin/wget"
# You need wget for this script to safely shutdown Sick Beard.
HOST
=
"127.0.0.1"
# Set Sick Beard address here.
PORT
=
"8081"
# Set Sick Beard port here.
SBUSR
=
""
# Set Sick Beard username (if you use one) here.
SBPWD
=
""
# Set Sick Beard password (if you use one) here.
status_cmd
=
"
${
name
}
_status"
stop_cmd
=
"
${
name
}
_stop"
command
=
"/usr/sbin/daemon"
command_args
=
"-f -p
${
sickbeard_pid
}
python
${
sickbeard_dir
}
/SickBeard.py
${
sickbeard_flags
}
--quiet"
# Check for wget and refuse to start without it.
if
[
!
-x
"
${
WGET
}
"
]
;
then
warn
"Sickbeard not started: You need wget to safely shut down Sick Beard."
exit
1
fi
# Ensure user is root when running this script.
if
[
`
id
-u
`
!=
"0"
]
;
then
echo
"Oops, you should be root before running this!"
exit
1
fi
verify_sickbeard_pid
()
{
# Make sure the pid corresponds to the Sick Beard process.
pid
=
`
cat
${
sickbeard_pid
}
2>/dev/null
`
ps
-p
${
pid
}
|
grep
-q
"python
${
sickbeard_dir
}
/SickBeard.py"
return
$?
}
# Try to stop Sick Beard cleanly by calling shutdown over http.
sickbeard_stop
()
{
echo
"Stopping
$name
"
verify_sickbeard_pid
${
WGET
}
-O
-
-q
--user
=
${
SBUSR
}
--password
=
${
SBPWD
}
"http://
${
HOST
}
:
${
PORT
}
/home/shutdown/"
>
/dev/null
if
[
-n
"
${
pid
}
"
]
;
then
wait_for_pids
${
pid
}
echo
"Stopped"
fi
}
sickbeard_status
()
{
verify_sickbeard_pid
&&
echo
"
$name
is running as
${
pid
}
"
||
echo
"
$name
is not running"
}
run_rc_command
"
$1
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment