现将本文安装 Red5 服务的启动脚本,red5,内容公布如下,以供参考:
#! /bin/sh
#
# Author: Jake Hilton <red5@jakehilton.com>
# /etc/init.d/red5
#
# Check for missing file
RED5_DIR=/opt/red5
test -x $RED5_DIR/red5.sh || exit 5
case "$1" in
start)
echo -n "Starting Red5 Service"
echo -n " "
cd $RED5_DIR
su -s /bin/bash -c "$RED5_DIR/red5.sh &" red5
sleep 2
;;
stop)
echo -n "Shutting down red5"
echo -n " "
cd $RED5_DIR
su -s /bin/bash -c "$RED5_DIR/red5-shutdown.sh &" red5
sleep 2
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
;;
esac
------------------------分割线------------------------
作者建议:读者自己动手测试时,最好是下载本文提供链接中的 red5 文件使用。因为 Windows 和 Linux 下换行符的编码是不一样的,如果不注意的话,在 Windows 下编辑好的 red5 放到 Linux 上,可能无法正确读取,造成 Red5 服务无法识别。
