👷 Thorough Docker iteration (#69)

👷 彻底的 Docker 迭代 (#69)
This commit is contained in:
nevinen 2021-05-02 00:48:32 +08:00 committed by GitHub
parent 5eeac6fb9a
commit 69dc6d83e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 939 additions and 815 deletions

View File

@ -1,4 +1,4 @@
name: "Docker"
name: "构建PagerMaid"
# Controls when the action will run.
on:
@ -9,17 +9,69 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Build PagerMaid Image
name: 构建PagerMaid
env:
DOCKER_BUILDKIT: 1
DOCKER_CLI_EXPERIMENTAL: enabled
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKER_USERNAME }}/pagermaid_modify
steps:
- name: Checkout master
uses: actions/checkout@master
- name: Build and publish image
uses: ilteoood/docker_buildx@master
- name: Checkout
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
publish: true
imageName: mrwangzhe/pagermaid_modify
dockerFile: Dockerfile
platform: linux/amd64,linux/arm64,linux/arm/v7
tag: latest
dockerUser: ${{ secrets.DOCKER_USERNAME }}
dockerPassword: ${{ secrets.DOCKER_PASSWORD }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Setup Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3
- name: Buildx cache
uses: actions/cache@v2
id: buildx-cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx
- name: Build
run: |
FULL_VERSION=$(curl https://api.github.com/repos/just-containers/s6-overlay/releases/latest | jq -r '.tag_name')
declare -a IMAGES
echo "Build amd64"
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--platform linux/amd64 \
--build-arg "S6_VERSION=${FULL_VERSION}" \
--build-arg "S6_ARCH=amd64" \
--tag "${DOCKERHUB_REPOSITORY}:latest-amd64" \
-f pagermaid/Dockerfile \
.
IMAGES+=( "${DOCKERHUB_REPOSITORY}:latest-amd64" )
echo "Build arm64-v8"
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--platform linux/arm64/v8 \
--build-arg "S6_VERSION=${FULL_VERSION}" \
--build-arg "S6_ARCH=aarch64" \
--tag "${DOCKERHUB_REPOSITORY}:latest-arm64-v8" \
-f pagermaid/Dockerfile \
.
IMAGES+=( "${DOCKERHUB_REPOSITORY}:latest-arm64-v8" )
echo "Create manifest lists"
docker manifest create "${DOCKERHUB_REPOSITORY}:latest" "${IMAGES[@]}"
echo "Annotate manifest lists to add architecture variants that aren't picked up automatically"
docker manifest annotate "${DOCKERHUB_REPOSITORY}:latest" "${DOCKERHUB_REPOSITORY}:latest-arm64-v8" --variant "v8"
echo "Push manifest lists & delete local copies"
docker manifest push --purge "${DOCKERHUB_REPOSITORY}:latest"

6
.gitignore vendored
View File

@ -120,8 +120,7 @@ pagermaid.session
pagermaid.session-journal
*.pagermaid
docker-compose.yml
plugins/*.py
plugins/*.py.disabled
plugins/
data/*
pagermaid.egg-info/
@ -142,3 +141,6 @@ dmypy.json
# Pyre type checker
.pyre/
# docker
install.lock

View File

@ -1,8 +1,125 @@
FROM mrwangzhe/pagermaid_os:latest
USER pagermaid
RUN mkdir /pagermaid/workdir
RUN git clone -b master https://github.com/Xtao-Labs/PagerMaid-Modify.git /pagermaid/workdir
WORKDIR /pagermaid/workdir
RUN python -m pip install -r requirements.txt \
&& rm -rf /pagermaid/.cache
CMD ["sh","utils/docker-run.sh"]
FROM ubuntu:hirsute
ARG S6_VERSION=v2.2.0.3
ARG S6_ARCH=amd64
ARG DEBIAN_FRONTEND=noninteractive
ARG USER_NAME=pagermaid
ARG WORK_DIR=/pagermaid/workdir
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
SHELL=/bin/bash \
LANG=zh_CN.UTF-8 \
PS1="\u@\h:\w \$ "
SHELL ["/bin/bash", "-c"]
WORKDIR $WORK_DIR
RUN source ~/.bashrc \
## 安装运行环境依赖,自编译建议修改为国内镜像源
# && sed -i 's/archive.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
# && sed -i 's/security.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
# && sed -i 's/ports.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install --no-install-recommends -y \
python3 \
python3-pip \
tesseract-ocr \
tesseract-ocr-eng \
tesseract-ocr-chi-sim \
language-pack-zh-hans \
sudo \
git \
openssl \
redis-server \
curl \
wget \
neofetch \
imagemagick \
ffmpeg \
fortune-mod \
figlet \
libmagic1 \
libzbar0 \
## 安装s6
&& curl -L -o /tmp/s6-overlay-installer https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${S6_ARCH}-installer \
&& chmod +x /tmp/s6-overlay-installer \
&& /tmp/s6-overlay-installer / \
## 安装编译依赖
&& apt-get update \
&& apt-get install --no-install-recommends -y \
## 这是跨平台交叉编译要用到的包,如果自行构建,有可能不需要
build-essential \
python3-dev \
libxslt1-dev \
libxml2-dev \
libssl-dev \
libffi-dev \
zlib1g-dev \
tcl8.6-dev \
tk8.6-dev \
libimagequant-dev \
libraqm-dev \
libjpeg-dev \
libtiff5-dev \
libopenjp2-7-dev \
libfreetype6-dev \
liblcms2-dev \
libwebp-dev \
python3-tk \
libharfbuzz-dev \
libfribidi-dev \
libxcb1-dev \
pkg-config \
## 设置时区
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
## python软链接
&& ln -sf /usr/bin/python3 /usr/bin/python \
## 升级pip
# && pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
&& python -m pip install --upgrade pip \
## 添加用户
&& useradd $USER_NAME -u 917 -U -r -m -d /$USER_NAME -s /bin/bash \
&& usermod -aG sudo,users $USER_NAME \
&& echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USER_NAME \
## 克隆仓库
&& git clone -b master https://github.com/nevinen/PagerMaid-Modify.git $WORK_DIR \
&& git config --global pull.ff only \
## 复制s6启动脚本
&& cp -r s6/* / \
## pip install
&& pip install -r requirements.txt \
## 卸载编译依赖,清理安装缓存
&& sudo apt-get purge --auto-remove -y \
build-essential \
python3-dev \
libxslt1-dev \
libxml2-dev \
libssl-dev \
libffi-dev \
zlib1g-dev \
tcl8.6-dev \
tk8.6-dev \
libimagequant-dev \
libraqm-dev \
libjpeg-dev \
libtiff5-dev \
libopenjp2-7-dev \
libfreetype6-dev \
liblcms2-dev \
libwebp-dev \
python3-tk \
libharfbuzz-dev \
libfribidi-dev \
libxcb1-dev \
pkg-config \
&& apt-get clean -y \
&& rm -rf \
## 删除apt和pip的安装缓存
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/* \
~/.cache \
## 最后改成国内源
&& sed -i 's/archive.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/security.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/ports.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
&& pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
ENTRYPOINT ["/init"]

View File

@ -1,58 +0,0 @@
FROM ubuntu:hirsute
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
LANG=zh_CN.UTF-8 \
SHELL=/bin/bash \
PS1="\u@\h:\w \$ " \
PAGERMAID_DIR=/pagermaid \
DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]
RUN source ~/.bashrc \
&& apt update \
&& apt upgrade -y \
&& apt install --no-install-recommends -y \
software-properties-common \
build-essential \
python3 \
python3-dev \
python3-pip \
python3-magic \
python3-dateparser \
tesseract-ocr \
tesseract-ocr-eng \
tesseract-ocr-chi-sim \
git \
openssl \
redis-server \
curl \
wget \
neofetch \
imagemagick \
ffmpeg \
fortune-mod \
figlet \
libzbar-dev \
libxslt1-dev \
libxml2-dev \
libfreetype-dev \
libffi-dev \
libopenblas-dev \
liblapack-dev \
libpqxx-dev \
&& apt clean -y \
&& apt autoclean -y
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
RUN ln -sf /usr/bin/python3 /usr/bin/python \
&& python -m pip install --upgrade pip \
&& pip install wheel \
&& pip install eyed3 pycryptodome
RUN sed -e 's;^# \(%wheel.*NOPASSWD.*\);\1;g' -i /etc/sudoers
RUN useradd pagermaid -r -m -d /pagermaid
RUN usermod -aG wheel,users pagermaid
USER pagermaid
RUN mkdir /pagermaid
RUN git clone -b master https://github.com/Xtao-Labs/PagerMaid-Modify.git /pagermaid
WORKDIR /pagermaid
RUN pip -m pip install -r requirements.txt
RUN sudo rm -rf /root/.cache
CMD ["sh","utils/docker-run.sh"]

View File

@ -1,11 +1,14 @@
version: "1.3"
version: "2.0"
services:
pagermaid:
image: mrwangzhe/pagermaid_modify
restart: always
container_name: "pagermaid"
container_name: pagermaid
hostname: "pagermaid"
#ports:
#- "3333:3333"
#- "3333:3333"
volumes:
- ./:/pagermaid/workdir
- ./:/pagermaid/workdir
environment:
- PUID=917
- PGID=917

File diff suppressed because it is too large Load Diff

7
s6/etc/cont-init.d/10-adduser Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/with-contenv bash
PUID=${PUID:-917}
PGID=${PGID:-917}
groupmod -o -g "$PGID" pagermaid
usermod -o -u "$PUID" pagermaid

3
s6/etc/cont-init.d/30-config Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/with-contenv bash
chown -R pagermaid:pagermaid /pagermaid

View File

@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
cd /pagermaid/workdir
exec s6-setuidgid pagermaid python -m pagermaid

3
s6/etc/services.d/redis/run Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/with-contenv bash
exec s6-setuidgid pagermaid redis-server --daemonize yes

95
utils/docker-config.sh Normal file
View File

@ -0,0 +1,95 @@
#!/usr/bin/with-contenv bash
welcome () {
echo
echo "欢迎进入 PagerMaid-Modify Docker 。"
echo "配置即将开始"
echo
sleep 2
}
configure () {
local config_file=config.yml
echo "生成配置文件中 . . ."
cp config.gen.yml $config_file
echo "api_key、api_hash 申请地址: https://my.telegram.org/"
printf "请输入应用程序 api_key"
read -r api_key <&1
sed -i "s/ID_HERE/$api_key/" $config_file
printf "请输入应用程序 api_hash"
read -r api_hash <&1
sed -i "s/HASH_HERE/$api_hash/" $config_file
printf "请输入应用程序语言默认zh-cn"
read -r application_language <&1
if [ -z "$application_language" ]
then
echo "语言设置为 简体中文"
else
sed -i "s/zh-cn/$application_language/" $config_file
fi
printf "请输入应用程序地区默认China"
read -r application_region <&1
if [ -z "$application_region" ]
then
echo "地区设置为 中国"
else
sed -i "s/China/$application_region/" $config_file
fi
printf "请输入 Google TTS 语言默认zh-CN"
read -r application_tts <&1
if [ -z "$application_tts" ]
then
echo "tts发音语言设置为 简体中文"
else
sed -i "s/zh-CN/$application_tts/" $config_file
fi
printf "启用日志记录? [Y/n]"
read -r logging_confirmation <&1
case $logging_confirmation in
[yY][eE][sS] | [yY])
printf "请输入您的日志记录群组/频道的 ChatID (如果要发送给 原 PagerMaid 作者 请按Enter"
read -r log_chatid <&1
if [ -z "$log_chatid" ]
then
echo "LOG 将发送到 原 PagerMaid 作者."
else
sed -i "s/503691334/$log_chatid/" $config_file
fi
sed -i "s/log: False/log: True/" $config_file
;;
[nN][oO] | [nN])
echo "安装过程继续 . . ."
;;
*)
echo "输入错误 . . ."
exit 1
;;
esac
}
login () {
echo
echo "下面进行程序运行。"
echo "请在账户授权完毕后,按 Ctrl + C 使 Docker 在后台模式下运行。"
echo
sleep 2
echo "Hello world!" > /pagermaid/workdir/install.lock
python -m pagermaid
exit 0
}
main () {
cd /pagermaid/workdir
if [ ! -s "/pagermaid/workdir/install.lock" ]; then
welcome
configure
login
else
if [ ! -f "/pagermaid/workdir/pagermaid.session" ]; then
login
fi
fi
}
main

View File

@ -1,98 +0,0 @@
#!/bin/bash
welcome() {
echo ""
echo "欢迎进入 PagerMaid-Modify Docker 。"
echo "配置即将开始"
echo ""
sleep 2
}
configure() {
cd /pagermaid/workdir
config_file=config.yml
echo "生成配置文件中 . . ."
cp config.gen.yml config.yml
echo "api_key、api_hash 申请地址: https://my.telegram.org/"
printf "请输入应用程序 api_key"
read -r api_key <&1
sed -i "s/ID_HERE/$api_key/" $config_file
printf "请输入应用程序 api_hash"
read -r api_hash <&1
sed -i "s/HASH_HERE/$api_hash/" $config_file
printf "请输入应用程序语言默认zh-cn"
read -r application_language <&1
if [ -z "$application_language" ]
then
echo "语言设置为 简体中文"
else
sed -i "s/zh-cn/$application_language/" $config_file
fi
printf "请输入应用程序地区默认China"
read -r application_region <&1
if [ -z "$application_region" ]
then
echo "地区设置为 中国"
else
sed -i "s/China/$application_region/" $config_file
fi
printf "请输入 Google TTS 语言默认zh-CN"
read -r application_tts <&1
if [ -z "$application_tts" ]
then
echo "tts发音语言设置为 简体中文"
else
sed -i "s/zh-CN/$application_tts/" $config_file
fi
printf "启用日志记录? [Y/n]"
read -r logging_confirmation <&1
case $logging_confirmation in
[yY][eE][sS]|[yY])
printf "请输入您的日志记录群组/频道的 ChatID (如果要发送给 原 PagerMaid 作者 请按Enter"
read -r log_chatid <&1
if [ -z "$log_chatid" ]
then
echo "LOG 将发送到 原 PagerMaid 作者."
else
sed -i "s/503691334/$log_chatid/" $config_file
fi
sed -i "s/log: False/log: True/" $config_file
;;
[nN][oO]|[nN])
echo "安装过程继续 . . ."
;;
*)
echo "输入错误 . . ."
exit 1
;;
esac
}
login() {
echo ""
echo "下面进行程序运行。"
echo "请在账户授权完毕后,按 Ctrl + C 使 Docker 在后台模式下运行。"
echo ""
sleep 2
echo "Hello world!" > /pagermaid/workdir/install.lock
python -m pagermaid
exit
}
start_installation() {
if [ ! -f "/pagermaid/workdir/install.lock" ]; then
welcome
configure
login
else
if [ ! -f "/pagermaid/workdir/pagermaid.session" ]; then
login
else
redis-server --daemonize yes
python -m pagermaid
fi
fi
}
start_installation

View File

@ -1,4 +1,5 @@
#!/bin/bash
#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]
then
clear
@ -7,168 +8,164 @@ then
fi
welcome() {
echo ""
echo "安装即将开始"
echo "如果您想取消安装,"
echo "请在 5 秒钟内按 Ctrl+C 终止此脚本。"
echo ""
sleep 5
echo
echo "安装即将开始"
echo "如果您想取消安装,"
echo "请在 5 秒钟内按 Ctrl+C 终止此脚本。"
echo
sleep 5
}
docker_check() {
echo "正在检查 Docker 安装情况 . . ."
if command -v docker >> /dev/null 2>&1;
then
echo "Docker 似乎存在, 安装过程继续 . . ."
else
echo "Docker 未安装在此系统上"
echo "请安装 Docker 并将自己添加到 Docker"
echo "分组并重新运行此脚本。"
exit 1
fi
}
git_check() {
echo "正在检查 Git 安装情况 . . ."
if command -v git >> /dev/null 2>&1;
then
echo "Git 似乎存在, 安装过程继续 . . ."
else
echo "Git 未安装在此系统上!"
echo "请安装 Git 并重新运行此脚本。"
exit 1
fi
docker_check () {
echo "正在检查 Docker 安装情况 . . ."
if command -v docker >> /dev/null 2>&1;
then
echo "Docker 似乎存在, 安装过程继续 . . ."
else
echo "Docker 未安装在此系统上"
echo "请安装 Docker 并将自己添加到 Docker"
echo "分组并重新运行此脚本。"
exit 1
fi
}
access_check() {
echo "测试 Docker 环境 . . ."
if [ -w /var/run/docker.sock ]
then
echo "该用户可以使用 Docker , 安装过程继续 . . ."
else
echo "该用户无权访问 Docker或者 Docker 没有运行。 请添加自己到 Docker 分组并重新运行此脚本。"
exit 1
fi
echo "测试 Docker 环境 . . ."
if [ -w /var/run/docker.sock ]
then
echo "该用户可以使用 Docker , 安装过程继续 . . ."
else
echo "该用户无权访问 Docker或者 Docker 没有运行。 请添加自己到 Docker 分组并重新运行此脚本。"
exit 1
fi
}
build_docker() {
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
echo "正在拉取 Docker 镜像 . . ."
docker rm -f "$container_name" > /dev/null 2>&1
docker pull mrwangzhe/pagermaid_modify
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
printf "请输入你想以哪个用户运行pagermaid该用户的PUID值如不懂请直接回车"
read -r puid <&1
PUID=${puid-:917}
printf "请输入你想以哪个用户运行pagermaid该用户的PGID值如不懂请直接回车"
read -r pgid <&1
PGID=${pgid-:917}
echo "正在拉取 Docker 镜像 . . ."
docker rm -f "$container_name" > /dev/null 2>&1
docker pull mrwangzhe/pagermaid_modify
}
start_docker() {
echo "正在启动 Docker 容器 . . ."
echo "在登录后,请按 Ctrl + C 使容器在后台模式下重新启动。"
sleep 3
docker run -it --restart=always --name="$container_name" --hostname="$container_name" mrwangzhe/pagermaid_modify <&1
echo ""
echo "Docker 创建完毕。"
echo ""
shon_online
echo "正在启动 Docker 容器 . . ."
docker run -dit -e PUID=$PUID -e PGID=$PGID --restart=always --name="$container_name" --hostname="$container_name" mrwangzhe/pagermaid_modify <&1
echo
echo "开始配置参数 . . ."
echo "在登录后,请按 Ctrl + C 使容器在后台模式下重新启动。"
sleep 3
docker exec -it -u pagermaid $container_name bash utils/docker-config.sh
echo
echo "Docker 创建完毕。"
echo
shon_online
}
start_installation() {
welcome
docker_check
git_check
access_check
build_docker
start_docker
welcome
docker_check
access_check
build_docker
start_docker
}
cleanup(){
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
echo "正在删除 Docker 镜像 . . ."
docker rm -f "$container_name" > /dev/null 2>&1
echo ""
shon_online
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
echo "正在删除 Docker 镜像 . . ."
docker rm -f "$container_name" > /dev/null 2>&1
echo ""
shon_online
}
stop_pager(){
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
echo "正在关闭 Docker 镜像 . . ."
docker stop "$container_name" > /dev/null 2>&1
echo ""
shon_online
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
echo "正在关闭 Docker 镜像 . . ."
docker stop "$container_name" > /dev/null 2>&1
echo ""
shon_online
}
start_pager(){
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
echo "正在启动 Docker 容器 . . ."
docker start $container_name > /dev/null 2>&1
echo ""
echo "Docker 启动完毕。"
echo ""
shon_online
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
echo "正在启动 Docker 容器 . . ."
docker start $container_name > /dev/null 2>&1
echo ""
echo "Docker 启动完毕。"
echo ""
shon_online
}
restart_pager(){
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
echo "正在重新启动 Docker 容器 . . ."
docker restart $container_name > /dev/null 2>&1
echo ""
echo "Docker 重新启动完毕。"
echo ""
shon_online
printf "请输入 PagerMaid 容器的名称:"
read -r container_name <&1
echo "正在重新启动 Docker 容器 . . ."
docker restart $container_name > /dev/null 2>&1
echo ""
echo "Docker 重新启动完毕。"
echo ""
shon_online
}
reinstall_pager(){
build_docker
start_docker
build_docker
start_docker
}
shon_online(){
echo ""
echo "欢迎使用 PagerMaid-Modify Docker 一键安装脚本。"
echo ""
echo "请选择您需要进行的操作:"
echo " 1) Docker 安装 PagerMaid"
echo " 2) Docker 卸载 PagerMaid"
echo " 3) 关闭 PagerMaid"
echo " 4) 启动 PagerMaid"
echo " 5) 重新启动 PagerMaid"
echo " 6) 重新安装 PagerMaid"
echo " 7) 退出脚本"
echo ""
echo " Version0.2.0"
echo ""
echo -n "请输入编号: "
read N
case $N in
1)
start_installation
;;
2)
cleanup
;;
3)
stop_pager
;;
4)
start_pager
;;
5)
restart_pager
;;
6)
reinstall_pager
;;
7)
exit
;;
*)
echo "Wrong input!"
sleep 5s
shon_online
;;
esac
echo
echo "欢迎使用 PagerMaid-Modify Docker 一键安装脚本。"
echo
echo "请选择您需要进行的操作:"
echo " 1) Docker 安装 PagerMaid"
echo " 2) Docker 卸载 PagerMaid"
echo " 3) 关闭 PagerMaid"
echo " 4) 启动 PagerMaid"
echo " 5) 重新启动 PagerMaid"
echo " 6) 重新安装 PagerMaid"
echo " 7) 退出脚本"
echo
echo " Version0.3.0"
echo
echo -n "请输入编号: "
read N
case $N in
1)
start_installation
;;
2)
cleanup
;;
3)
stop_pager
;;
4)
start_pager
;;
5)
restart_pager
;;
6)
reinstall_pager
;;
7)
exit 0
;;
*)
echo "Wrong input!"
sleep 5s
shon_online
;;
esac
}
shon_online

View File

@ -1,4 +0,0 @@
#!/bin/sh
redis-server --daemonize yes
. /pagermaid/venv/bin/activate
/usr/bin/env python3 -m pagermaid