Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Blanc
scripts
Commits
50948688
Commit
50948688
authored
Aug 26, 2013
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[mumudvb] initscript avec possibilité de n'agir que sur un adaptateur
parent
ae872e5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
130 additions
and
0 deletions
+130
-0
tv/mumudvb.init
tv/mumudvb.init
+130
-0
No files found.
tv/mumudvb.init
0 → 100755
View file @
50948688
#!/bin/sh
### BEGIN INIT INFO
# Provides: mumudvb
# Required-Start: $remote_fs $network $syslog
# Required-Stop: $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mumudvb
# Description: Digital television streaming program
### END INIT INFO
PATH
=
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON
=
/usr/bin/mumudvb
PIDDIR
=
/var/run/mumudvb
DEFAULT_FILE
=
/etc/default/mumudvb
NAME
=
mumudvb
DESC
=
"television streaming program"
#Reading of the config file
if
[
-f
"
$DEFAULT_FILE
"
]
;
then
.
"
$DEFAULT_FILE
"
fi
if
[
"
$DONTSTARTMUMU
"
=
"true"
]
;
then
exit
0
;
fi
.
/lib/lsb/init-functions
test
-x
$DAEMON
||
exit
5
set
-e
do_start
()
{
if
[
!
-d
$PIDDIR
]
;
then
mkdir
-p
$PIDDIR
fi
chown
$DAEMONUSER
$PIDDIR
if
[
-x
"
$LAUNCH_BEFORE_MUMU
"
]
;
then
log_daemon_msg
"Launching pre script ..."
eval
$LAUNCH_BEFORE_MUMU
log_daemon_msg
"Done."
fi
if
test
-z
"
$2
"
;
then
RET
=
1
for
ADAPTER
in
$ADAPTERS
;
do
log_daemon_msg
" Starting card
$ADAPTER
"
eval
CONFIG_FILE
=
\$
MUMUDVB_CONF_
$ADAPTER
if
[
!
-f
$CONFIG_FILE
]
;
then
log_warning_msg
" Card
$ADAPTER
: Config file
$CONFIG_FILE
not found."
else
start-stop-daemon
--start
--oknodo
--pidfile
"
$PIDDIR
/mumudvb_carte
$ADAPTER
.pid"
\
--chuid
$DAEMONUSER
--exec
$DAEMON
--
$DAEMON_OPTS
--card
$ADAPTER
-c
$CONFIG_FILE
RET
=
$((
$RET
*
$?
))
fi
done
return
$RET
else
ADAPTER
=
$2
log_daemon_msg
" Starting card
$ADAPTER
"
eval
CONFIG_FILE
=
\$
MUMUDVB_CONF_
$ADAPTER
if
[
!
-z
$CONFIG_FILE
]
;
then
if
[
!
-f
$CONFIG_FILE
]
;
then
log_warning_msg
" Card
$ADAPTER
: Config file
$CONFIG_FILE
not found."
else
start-stop-daemon
--start
--oknodo
--pidfile
"
$PIDDIR
/mumudvb_adapter
${
ADAPTER
}
_tuner0.pid"
\
--chuid
$DAEMONUSER
--exec
$DAEMON
--
$DAEMON_OPTS
--card
$ADAPTER
-c
$CONFIG_FILE
return
$?
fi
else
log_failure_msg
" MUMUDVB_CONF_
$ADAPTER
not set."
return
1
fi
fi
}
do_stop
()
{
if
test
-z
"
$2
"
;
then
RET
=
1
for
PIDFILE
in
`
ls
$PIDDIR
/mumudvb_adapter
*
.pid 2> /dev/null
`
;
do
start-stop-daemon
--stop
--oknodo
--pidfile
"
$PIDFILE
"
\
--exec
$DAEMON
RET
=
$((
$RET
*
$?
))
done
return
$RET
else
ADAPTER
=
$2
log_daemon_msg
" Stopping card
$ADAPTER
"
if
[
-f
"
$PIDDIR
/mumudvb_adapter
${
ADAPTER
}
_tuner0.pid"
]
;
then
start-stop-daemon
--stop
--oknodo
--pidfile
"
$PIDDIR
/mumudvb_adapter
${
ADAPTER
}
_tuner0.pid"
\
--exec
$DAEMON
return
$?
else
log_warning_msg
"
$PIDDIR
/mumudvb_adapter
${
ADAPTER
}
_tuner0.pid not found"
return
1
fi
fi
}
case
"
$1
"
in
start
)
if
[
!
-f
"
$DEFAULT_FILE
"
]
;
then
log_failure_msg
"
$DEFAULT_FILE
not found, Can't start
$NAME
"
exit
6
fi
log_daemon_msg
"Starting
$DESC
:
$NAME
"
do_start
$@
log_end_msg
$?
;;
stop
)
log_daemon_msg
"Stopping
$DESC
:
$NAME
"
do_stop
$@
log_end_msg
$?
;;
restart|force-reload
)
log_daemon_msg
"Restarting
$DESC
:
$NAME
"
do_stop
$@
sleep
1
do_start
$@
log_end_msg
$?
;;
status
)
status_of_proc
"
$DAEMON
"
"
$DESC
:
$NAME
"
&&
exit
0
||
exit
$?
;;
*
)
log_success_msg
"Usage:
$0
{start|stop|restart|force-reload|status} [adaptater number]"
>
&2
exit
1
;;
esac
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment