mirror of
https://github.com/kxgx/2.13-Ink-screen-clock.git
synced 2026-05-12 02:35:04 +08:00
更新 install.sh
This commit is contained in:
115
bin/install.sh
115
bin/install.sh
@@ -20,80 +20,83 @@ DEBIAN_VERSION=$(cat /etc/debian_version)
|
|||||||
# 树莓派Raspberry Pi相关命令
|
# 树莓派Raspberry Pi相关命令
|
||||||
RASPBERRY_PI_CPUINFO=$(grep -q 'Raspberry Pi' /proc/cpuinfo)
|
RASPBERRY_PI_CPUINFO=$(grep -q 'Raspberry Pi' /proc/cpuinfo)
|
||||||
|
|
||||||
|
# 定义链接变量
|
||||||
|
DEBIAN_MIRROR="https://mirrors.cernet.edu.cn/debian/"
|
||||||
|
DEBIAN_SECURITY_MIRROR="https://mirrors.cernet.edu.cn/debian-security"
|
||||||
|
PI_SUGAR_POWER_MANAGER_URL="https://cdn.pisugar.com/release/pisugar-power-manager.sh"
|
||||||
|
INK_SCREEN_CLOCK_REPO_URL="https://gitee.com/xingguangk/2.13-Ink-screen-clock.git"
|
||||||
|
PIPY_MIRROR="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
|
||||||
|
|
||||||
# Debian 11 (Bullseye) 相关命令
|
# Debian 11 (Bullseye) 相关命令
|
||||||
UPDATE_SOURCES_LIST_BULLSEYE="sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak && sudo cat <<'EOF' > /etc/apt/sources.list
|
UPDATE_SOURCES_LIST_BULLSEYE="sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak && sudo cat <<'EOF' > /etc/apt/sources.list
|
||||||
deb https://mirrors.cernet.edu.cn/debian/ bullseye main contrib non-free
|
deb $DEBIAN_MIRROR bullseye main contrib non-free
|
||||||
# deb-src https://mirrors.cernet.edu.cn/debian/ bullseye main contrib non-free
|
# deb-src $DEBIAN_MIRROR bullseye main contrib non-free
|
||||||
|
|
||||||
deb https://mirrors.cernet.edu.cn/debian/ bullseye-updates main contrib non-free
|
deb $DEBIAN_MIRROR bullseye-updates main contrib non-free
|
||||||
# deb-src https://mirrors.cernet.edu.cn/debian/ bullseye-updates main contrib non-free
|
# deb-src $DEBIAN_MIRROR bullseye-updates main contrib non-free
|
||||||
|
|
||||||
deb https://mirrors.cernet.edu.cn/debian/ bullseye-backports main contrib non-free
|
deb $DEBIAN_MIRROR bullseye-backports main contrib non-free
|
||||||
# deb-src https://mirrors.cernet.edu.cn/debian/ bullseye-backports main contrib non-free
|
# deb-src $DEBIAN_MIRROR bullseye-backports main contrib non-free
|
||||||
|
|
||||||
deb https://mirrors.cernet.edu.cn/debian-security bullseye-security main contrib non-free
|
deb $DEBIAN_SECURITY_MIRROR bullseye-security main contrib non-free
|
||||||
# deb-src https://mirrors.cernet.edu.cn/debian-security bullseye-security main contrib non-free
|
# deb-src $DEBIAN_SECURITY_MIRROR bullseye-security main contrib non-free
|
||||||
EOF"
|
EOF"
|
||||||
INSTALL_PACKAGES_BULLSEYE="sudo apt-get update && sudo apt-get install -y git pigpio raspi-config netcat gawk python3-dev python3-pip python3-pil python3-numpy python3-gpiozero python3-pigpio build-essential"
|
INSTALL_PACKAGES_BULLSEYE="sudo apt-get update && sudo apt-get install -y git pigpio raspi-config netcat gawk python3-dev python3-pip python3-pil python3-numpy python3-gpiozero python3-pigpio build-essential"
|
||||||
INSTALL_PIP_PACKAGES_BULLSEYE="sudo pip3 install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple spidev borax pillow requests --break-system-packages"
|
INSTALL_PIP_PACKAGES_BULLSEYE="sudo pip3 install -i $PIPY_MIRROR spidev borax pillow requests --break-system-packages"
|
||||||
DOWNLOAD_AND_EXECUTE_BULLSEYE="wget https://cdn.pisugar.com/release/pisugar-power-manager.sh && bash pisugar-power-manager.sh -c release"
|
DOWNLOAD_AND_EXECUTE_BULLSEYE="wget $PI_SUGAR_POWER_MANAGER_URL && bash pisugar-power-manager.sh -c release"
|
||||||
CLONE_AND_EXECUTE_BULLSEYE="cd ~ && git clone https://gitee.com/xingguangk/2.13-Ink-screen-clock.git && cd ~/2.13-Ink-screen-clock/bin/ && sudo chmod +x start.sh && sudo ./start.sh"
|
CLONE_AND_EXECUTE_BULLSEYE="cd ~ && git clone $INK_SCREEN_CLOCK_REPO_URL && cd ~/2.13-Ink-screen-clock/bin/ && sudo chmod +x start.sh && sudo ./start.sh"
|
||||||
|
|
||||||
# Debian 12 (Bookworm) 相关命令
|
# Debian 12 (Bookworm) 相关命令
|
||||||
UPDATE_SOURCES_LIST_BOOKWORM="sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak && sudo cat <<'EOF' > /etc/apt/sources.list
|
UPDATE_SOURCES_LIST_BOOKWORM="sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak && sudo cat <<'EOF' > /etc/apt/sources.list
|
||||||
deb https://mirrors.cernet.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
|
deb $DEBIAN_MIRROR bookworm main contrib non-free non-free-firmware
|
||||||
# deb-src https://mirrors.cernet.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
|
# deb-src $DEBIAN_MIRROR bookworm main contrib non-free non-free-firmware
|
||||||
|
|
||||||
deb https://mirrors.cernet.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
|
deb $DEBIAN_MIRROR bookworm-updates main contrib non-free non-free-firmware
|
||||||
# deb-src https://mirrors.cernet.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
|
# deb-src $DEBIAN_MIRROR bookworm-updates main contrib non-free non-free-firmware
|
||||||
|
|
||||||
deb https://mirrors.cernet.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
|
deb $DEBIAN_MIRROR bookworm-backports main contrib non-free non-free-firmware
|
||||||
# deb-src https://mirrors.cernet.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
|
# deb-src $DEBIAN_MIRROR bookworm-backports main contrib non-free non-free-firmware
|
||||||
|
|
||||||
deb https://mirrors.cernet.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
|
deb $DEBIAN_SECURITY_MIRROR bookworm-security main contrib non-free non-free-firmware
|
||||||
# deb-src https://mirrors.cernet.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
|
# deb-src $DEBIAN_SECURITY_MIRROR bookworm-security main contrib non-free non-free-firmware
|
||||||
EOF"
|
EOF"
|
||||||
INSTALL_PACKAGES_BOOKWORM="sudo apt-get update && sudo apt-get install -y git pigpio raspi-config netcat gawk python3-dev python3-pip python3-pil python3-numpy python3-gpiozero python3-pigpio build-essential"
|
INSTALL_PACKAGES_BOOKWORM="sudo apt-get update && sudo apt-get install -y git pigpio raspi-config netcat gawk python3-dev python3-pip python3-pil python3-numpy python3-gpiozero python3-pigpio build-essential"
|
||||||
INSTALL_PIP_PACKAGES_BOOKWORM="sudo pip3 install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple spidev borax pillow requests --break-system-packages"
|
INSTALL_PIP_PACKAGES_BOOKWORM="sudo pip3 install -i $PIPY_MIRROR spidev borax pillow requests --break-system-packages"
|
||||||
DOWNLOAD_AND_EXECUTE_BOOKWORM="wget https://cdn.pisugar.com/release/pisugar-power-manager.sh && bash pisugar-power-manager.sh -c release"
|
DOWNLOAD_AND_EXECUTE_BOOKWORM="wget $PI_SUGAR_POWER_MANAGER_URL && bash pisugar-power-manager.sh -c release"
|
||||||
CLONE_AND_EXECUTE_BOOKWORM="cd ~ && git clone https://gitee.com/xingguangk/2.13-Ink-screen-clock.git && cd ~/2.13-Ink-screen-clock/bin/ && sudo chmod +x start.sh && sudo ./start.sh"
|
CLONE_AND_EXECUTE_BOOKWORM="cd ~ && git clone $INK_SCREEN_CLOCK_REPO_URL && cd ~/2.13-Ink-screen-clock/bin/ && sudo chmod +x start.sh && sudo ./start.sh"
|
||||||
|
|
||||||
# 主逻辑
|
# 主逻辑
|
||||||
# 检测是否是Debian系统
|
# 检测是否是Raspberry Pi系统
|
||||||
if [ -f /etc/debian_version ]; then
|
if [ "$RASPBERRY_PI_CPUINFO" ]; then
|
||||||
echo "检测到Debian系统,版本号为: $DEBIAN_VERSION"
|
echo "检测到Raspberry Pi系统。"
|
||||||
|
|
||||||
# 检测是否是Raspberry Pi
|
# 根据Debian版本执行不同的命令
|
||||||
if $RASPBERRY_PI_CPUINFO; then
|
case "$DEBIAN_VERSION" in
|
||||||
echo "检测到Raspberry Pi系统。"
|
*bullseye*)
|
||||||
|
echo "执行Debian 11 (Bullseye) 相关操作"
|
||||||
# 根据Debian版本执行不同的命令
|
eval $UPDATE_SOURCES_LIST_BULLSEYE
|
||||||
case $DEBIAN_VERSION in
|
eval $INSTALL_PACKAGES_BULLSEYE
|
||||||
*bullseye*)
|
eval $INSTALL_PIP_PACKAGES_BULLSEYE
|
||||||
echo "执行Debian 11 (Bullseye) 相关操作..."
|
eval $DOWNLOAD_AND_EXECUTE_BULLSEYE
|
||||||
eval $UPDATE_SOURCES_LIST_BULLSEYE
|
eval $CLONE_AND_EXECUTE_BULLSEYE
|
||||||
eval $INSTALL_PACKAGES_BULLSEYE
|
;;
|
||||||
eval $INSTALL_PIP_PACKAGES_BULLSEYE
|
*bookworm*)
|
||||||
eval $DOWNLOAD_AND_EXECUTE_BULLSEYE
|
echo "执行Debian 12 (Bookworm) 相关操作"
|
||||||
eval $CLONE_AND_EXECUTE_BULLSEYE
|
eval $UPDATE_SOURCES_LIST_BOOKWORM
|
||||||
;;
|
eval $INSTALL_PACKAGES_BOOKWORM
|
||||||
*bookworm*)
|
eval $INSTALL_PIP_PACKAGES_BOOKWORM
|
||||||
echo "执行Debian 12 (Bookworm) 相关操作..."
|
eval $DOWNLOAD_AND_EXECUTE_BOOKWORM
|
||||||
eval $UPDATE_SOURCES_LIST_BOOKWORM
|
eval $CLONE_AND_EXECUTE_BOOKWORM
|
||||||
eval $INSTALL_PACKAGES_BOOKWORM
|
;;
|
||||||
eval $INSTALL_PIP_PACKAGES_BOOKWORM
|
*)
|
||||||
eval $DOWNLOAD_AND_EXECUTE_BOOKWORM
|
echo "未知的Debian版本: $DEBIAN_VERSION"
|
||||||
eval $CLONE_AND_EXECUTE_BOOKWORM
|
exit 1
|
||||||
;;
|
;;
|
||||||
*)
|
esac
|
||||||
echo "未知的Debian版本: $DEBIAN_VERSION"
|
else
|
||||||
exit 1
|
echo "这不是Raspberry Pi系统。"
|
||||||
;;
|
exit 0
|
||||||
esac
|
fi
|
||||||
else
|
|
||||||
echo "这不是Raspberry Pi系统。"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "这不是一个Debian系统。"
|
echo "这不是一个Debian系统。"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user