Advertisement
jamesdtyler

Untitled

Nov 19th, 2018
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.67 KB | None | 0 0
  1. [Mon Nov 19-14:13:12] tyler@shade : [~]
  2.  $ : cat /etc/emby*
  3. EMBY_DATA=/var/lib/embyEMBY_DATA=/var/lib/emby[Mon Nov 19-14:13:16] tyler@shade : [~]
  4.  $ : cat /etc/default/emby*
  5. [Mon Nov 19-14:13:16] tyler@shade : [~]
  6.  $ : cat /etc/init.d/emby*
  7. #!/bin/bash
  8. ### BEGIN INIT INFO
  9. # Provides:          emby-server
  10. # Required-Start:    $remote_fs $local_fs $network
  11. # Required-Stop:     $remote_fs $local_fs $network
  12. # Default-Start:     2 3 4 5
  13. # Default-Stop:      0 1 6
  14. # Short-Description: starts instance of Emby
  15. # Description:       starts instance of Emby
  16. ### END INIT INFO
  17.  
  18. # chkconfig: 2345 20 80
  19. #The above indicates that the script should be started in levels 2, 3, 4, and 5, #that its start priority should be 20, and that its stop priority should be 80.
  20. # Load the VERBOSE setting and other rcS variables
  21. . /lib/init/vars.sh
  22.  
  23. # Define LSB log_* functions.
  24. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
  25. . /lib/lsb/init-functions
  26.  
  27. NAME=emby-server
  28. CONF_FILE=/etc/${NAME}.conf
  29. DEFAULT_FILE=/etc/default/${NAME}
  30.  
  31. APP_DIR=/opt/emby-server
  32. export FONTCONFIG_PATH=$APP_DIR/etc/fonts
  33. export ICU_DATA=$APP_DIR/share/icu/61.1
  34. export LD_LIBRARY_PATH=$APP_DIR/lib:$APP_DIR/lib/samba
  35. export LIBVA_DRIVERS_PATH=$APP_DIR/lib/dri
  36. export SSL_CERT_FILE=$APP_DIR/etc/ssl/certs/ca-certificates.crt
  37.  
  38. # Source Emby server default configuration
  39. . $DEFAULT_FILE
  40.  
  41. # Source Emby server user configuration overrides
  42. if [[ -f $CONF_FILE ]]; then
  43.   . $CONF_FILE
  44. else
  45.   echo "${CONF_FILE} not found using default settings.";
  46. fi
  47.  
  48. # Path of emby binary
  49. DAEMON=${APP_DIR}/system/EmbyServer
  50. ARGS="-programdata $EMBY_DATA \
  51.  -ffmpeg $APP_DIR/bin/ffmpeg \
  52.  -ffprobe $APP_DIR/bin/ffprobe \
  53.  -restartexitcode 3 \
  54.  -updatepackage 'emby-server-deb_{version}_amd64.deb'"
  55. PIDFILE=${EMBY_PIDFILE-/var/run/emby-server.pid}
  56.  
  57. case "$1" in
  58.   start)
  59.     log_daemon_msg "Starting $NAME daemon"
  60.     start-stop-daemon --start --quiet --background --chuid ${EMBY_USER}:${EMBY_GROUP} \
  61.         --make-pidfile --pidfile $PIDFILE \
  62.         --exec $DAEMON -- $ARGS
  63.     log_end_msg $?
  64.     ;;
  65.   stop)
  66.     log_daemon_msg "Stopping $NAME daemon"
  67.     start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
  68.         --remove-pidfile --pidfile $PIDFILE \
  69.         --exec $DAEMON -- $ARGS
  70.     log_end_msg $?
  71.     ;;
  72.   status)
  73.     status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
  74.     ;;
  75.   restart|force-reload)
  76.     $0 stop || exit $?
  77.     $0 start || exit $?
  78.     ;;
  79.   *)
  80.     echo "Usage: /etc/init.d/emby-server {start|stop|status|restart|force-reload}" >&2
  81.     exit 3
  82.     ;;
  83. esac[Mon Nov 19-14:13:18] tyler@shade : [~]
  84.  $ : ^C
  85. [Mon Nov 19-14:13:49] tyler@shade : [~]
  86.  $ :
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement