# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
-# TODO: check for proper kernel version
+# Exit if the module is not available
+modprobe --dry-run --quiet dvbloopback || exit 0
+
+# Exit if the kernel has no 'sasc' in its version name,
+# indicating it's not patched for sasc
+uname -v | grep -q sasc || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || true ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 || true ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || true ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 || true ;;
esac
;;
#reload|force-reload)
0|1)
do_start
case "$?" in
- 0) log_end_msg 0 ;;
- 1) log_end_msg 1 ;; # Old process is still running
- *) log_end_msg 1 ;; # Failed to start
+ 0) log_end_msg 0 || true ;;
+ 1) log_end_msg 1 || true ;; # Old process is still running
+ *) log_end_msg 1 || true ;; # Failed to start
esac
;;
*)