B站录播姬docker容器更新脚本

老鸽子 发布于 2023-12-31 380 次阅读


安装请参考官方教程。以下为更新脚本bilirec-update.sh

#!/bin/bash
if (( $EUID != 0 )); then
    echo "$0: root permission is required"
    exit
fi

# 镜像地址
image="bililive/recorder"
tag="latest"
# 容器名
container_name="ghcr.io/bililiverecorder/bililiverecorder"
# 工作目录
rec_path="/path/to/recording"
# 端口
port="2356"
# 用户名 密码
username="username"
password="password"

echo ":: Pulling $image:$tag ..."
docker pull $image:$tag
echo ":: Removing old container ..."
docker stop $container_name
docker rm $container_name
echo ":: Creating new container ..."
docker run -d \
  --name $container_name \
  --restart unless-stopped \
  -p $port:2356 \
  -v $rec_path:/rec \
  -e BREC_HTTP_BASIC_USER=$username \
  -e BREC_HTTP_BASIC_PASS=$password \
  $image:$tag
echo ":: done!"
咕咕咕~
最后更新于 2024-07-22