add Teslamate docker

This commit is contained in:
悟空的日常镜像仓库 2024-05-11 21:41:36 +08:00
parent 4758a351b5
commit e3eeee9b0a
1 changed files with 25 additions and 5 deletions

View File

@ -36,6 +36,7 @@ menu_options=(
"修改小雅转存文件夹ID(40位)" "修改小雅转存文件夹ID(40位)"
"安装内网穿透工具Cpolar" "安装内网穿透工具Cpolar"
"安装盒子助手docker版" "安装盒子助手docker版"
"安装特斯拉伴侣TeslaMate"
"安装CasaOS面板" "安装CasaOS面板"
"更新脚本" "更新脚本"
) )
@ -57,7 +58,8 @@ commands=(
["安装CasaOS面板"]="install_casaos" ["安装CasaOS面板"]="install_casaos"
["更新脚本"]="update_scripts" ["更新脚本"]="update_scripts"
["安装小雅tvbox"]="install_xiaoya_tvbox" ["安装小雅tvbox"]="install_xiaoya_tvbox"
["安装特斯拉伴侣TeslaMate"]="install_teslamate"
) )
# 更新系统软件包 # 更新系统软件包
@ -68,10 +70,10 @@ update_system_packages() {
green "Updating system packages..." green "Updating system packages..."
sudo apt update sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
if ! command -v curl &> /dev/null; then if ! command -v curl &>/dev/null; then
red "curl is not installed. Installing now..." red "curl is not installed. Installing now..."
sudo apt install -y curl sudo apt install -y curl
if command -v curl &> /dev/null; then if command -v curl &>/dev/null; then
green "curl has been installed successfully." green "curl has been installed successfully."
else else
echo "Failed to install curl. Please check for errors." echo "Failed to install curl. Please check for errors."
@ -457,7 +459,7 @@ update_scripts() {
# 安装小雅xiaoya-tvbox # 安装小雅xiaoya-tvbox
# 参考 https://har01d.cn/notes/alist-tvbox.html # 参考 https://har01d.cn/notes/alist-tvbox.html
install_xiaoya_tvbox(){ install_xiaoya_tvbox() {
local host_ip local host_ip
host_ip=$(hostname -I | awk '{print $1}') host_ip=$(hostname -I | awk '{print $1}')
wget -qO xt.sh https://d.har01d.cn/update_xiaoya.sh wget -qO xt.sh https://d.har01d.cn/update_xiaoya.sh
@ -474,6 +476,24 @@ install_xiaoya_tvbox(){
密码: guest_Api789 密码: guest_Api789
' '
} }
# 安装特斯拉伴侣
install_teslamate() {
check_docker_compose
sudo mkdir -p /opt/teslamate
wget -O /opt/teslamate/docker-compose.yml https://cafe.cpolar.cn/wkdaily/zero3/raw/branch/main/teslamate/docker-compose.yml
cd /opt/teslamate
sudo docker-compose up -d
}
check_docker_compose() {
if which docker-compose > /dev/null 2>&1; then
echo "Docker Compose is installed."
docker-compose --version
else
echo "Docker Compose is not installed. You can install 1panel first."
exit 1
fi
}
show_menu() { show_menu() {
clear clear
@ -488,7 +508,7 @@ show_menu() {
echo "请选择操作:" echo "请选择操作:"
# 特殊处理的项数组 # 特殊处理的项数组
special_items=("安装小雅tvbox") special_items=("安装小雅tvbox" "安装特斯拉伴侣TeslaMate")
for i in "${!menu_options[@]}"; do for i in "${!menu_options[@]}"; do
if [[ " ${special_items[*]} " =~ " ${menu_options[i]} " ]]; then if [[ " ${special_items[*]} " =~ " ${menu_options[i]} " ]]; then
# 如果当前项在特殊处理项数组中,使用特殊颜色 # 如果当前项在特殊处理项数组中,使用特殊颜色