feat: add driver manager auth updater
This commit is contained in:
11
README.md
11
README.md
@@ -11,6 +11,7 @@
|
|||||||
- 虚拟 PDF 打印机(测试连接用)
|
- 虚拟 PDF 打印机(测试连接用)
|
||||||
- 多种打印机驱动可选
|
- 多种打印机驱动可选
|
||||||
- 驱动管理器(默认仅允许内网访问)
|
- 驱动管理器(默认仅允许内网访问)
|
||||||
|
- 驱动管理器账号密码可通过脚本菜单修改
|
||||||
- 网络和打印服务守护(断网自动切 DHCP,CUPS 卡死自动恢复)
|
- 网络和打印服务守护(断网自动切 DHCP,CUPS 卡死自动恢复)
|
||||||
- 静态 IP 支持网关变更自愈:先切 DHCP,再按原静态 IP 尾号迁移到新网段
|
- 静态 IP 支持网关变更自愈:先切 DHCP,再按原静态 IP 尾号迁移到新网段
|
||||||
- 支持一键卸载
|
- 支持一键卸载
|
||||||
@@ -36,6 +37,16 @@ chmod +x setup_cups.sh
|
|||||||
./setup_cups.sh --uninstall
|
./setup_cups.sh --uninstall
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 修改驱动管理器账号密码
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 方式一:从主菜单选择“修改驱动管理器用户名和密码”
|
||||||
|
./setup_cups.sh
|
||||||
|
|
||||||
|
# 方式二:直接进入账号密码修改流程
|
||||||
|
./setup_cups.sh --driver-manager-auth
|
||||||
|
```
|
||||||
|
|
||||||
## 驱动选项
|
## 驱动选项
|
||||||
|
|
||||||
安装时可选择以下驱动:
|
安装时可选择以下驱动:
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ WorkingDirectory=/opt/cups-driver-manager
|
|||||||
ExecStart=/usr/bin/python3 /opt/cups-driver-manager/driver_manager.py --host 0.0.0.0 --port 632
|
ExecStart=/usr/bin/python3 /opt/cups-driver-manager/driver_manager.py --host 0.0.0.0 --port 632
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
Environment=DRIVER_MANAGER_USERNAME=admin
|
||||||
Environment=DRIVER_MANAGER_PASSWORD=admin
|
Environment=DRIVER_MANAGER_PASSWORD=admin
|
||||||
Environment=DRIVER_MANAGER_ALLOW_PRIVATE_ONLY=1
|
Environment=DRIVER_MANAGER_ALLOW_PRIVATE_ONLY=1
|
||||||
|
|
||||||
|
|||||||
@@ -1057,17 +1057,20 @@ def main():
|
|||||||
parser = argparse.ArgumentParser(description='CUPS 打印机驱动管理器')
|
parser = argparse.ArgumentParser(description='CUPS 打印机驱动管理器')
|
||||||
parser.add_argument('-p', '--port', type=int, default=632, help='监听端口 (默认: 632)')
|
parser.add_argument('-p', '--port', type=int, default=632, help='监听端口 (默认: 632)')
|
||||||
parser.add_argument('-H', '--host', default='0.0.0.0', help='监听地址 (默认: 0.0.0.0)')
|
parser.add_argument('-H', '--host', default='0.0.0.0', help='监听地址 (默认: 0.0.0.0)')
|
||||||
|
parser.add_argument('--username', default=None, help='管理员用户名')
|
||||||
parser.add_argument('--password', default=None, help='管理员密码')
|
parser.add_argument('--password', default=None, help='管理员密码')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
global ADMIN_PASSWORD
|
global ADMIN_USERNAME, ADMIN_PASSWORD
|
||||||
|
if args.username:
|
||||||
|
ADMIN_USERNAME = args.username
|
||||||
if args.password:
|
if args.password:
|
||||||
ADMIN_PASSWORD = args.password
|
ADMIN_PASSWORD = args.password
|
||||||
|
|
||||||
print(f"CUPS 驱动管理器启动中...")
|
print(f"CUPS 驱动管理器启动中...")
|
||||||
print(f"访问地址: http://localhost:{args.port}/")
|
print(f"访问地址: http://localhost:{args.port}/")
|
||||||
print(f"默认用户名: admin")
|
print(f"用户名: {ADMIN_USERNAME}")
|
||||||
print(f"默认密码: {ADMIN_PASSWORD}")
|
print(f"密码: {ADMIN_PASSWORD}")
|
||||||
print("-" * 40)
|
print("-" * 40)
|
||||||
|
|
||||||
app.run(host=args.host, port=args.port, debug=False)
|
app.run(host=args.host, port=args.port, debug=False)
|
||||||
|
|||||||
186
setup_cups.sh
186
setup_cups.sh
@@ -22,6 +22,7 @@ REPO_ARCHIVE_URL="${REPO_ARCHIVE_URL:-https://git.workyai.cn/237899745/S905L3A/a
|
|||||||
REPO_ARCHIVE_FALLBACK_URL="${REPO_ARCHIVE_FALLBACK_URL:-https://gitee.com/yu-yon/S905L3A/repository/archive/master.zip}"
|
REPO_ARCHIVE_FALLBACK_URL="${REPO_ARCHIVE_FALLBACK_URL:-https://gitee.com/yu-yon/S905L3A/repository/archive/master.zip}"
|
||||||
CUPS_ALLOWED_NET="${CUPS_ALLOWED_NET:-@LOCAL}"
|
CUPS_ALLOWED_NET="${CUPS_ALLOWED_NET:-@LOCAL}"
|
||||||
DRIVER_MANAGER_HOST="${DRIVER_MANAGER_HOST:-0.0.0.0}"
|
DRIVER_MANAGER_HOST="${DRIVER_MANAGER_HOST:-0.0.0.0}"
|
||||||
|
DRIVER_MANAGER_USERNAME="${DRIVER_MANAGER_USERNAME:-admin}"
|
||||||
DRIVER_MANAGER_PRIVATE_ONLY="${DRIVER_MANAGER_PRIVATE_ONLY:-1}"
|
DRIVER_MANAGER_PRIVATE_ONLY="${DRIVER_MANAGER_PRIVATE_ONLY:-1}"
|
||||||
|
|
||||||
# 打印带颜色的信息
|
# 打印带颜色的信息
|
||||||
@@ -30,6 +31,15 @@ success() { echo -e "${GREEN}[成功]${NC} $1"; }
|
|||||||
warn() { echo -e "${YELLOW}[警告]${NC} $1"; }
|
warn() { echo -e "${YELLOW}[警告]${NC} $1"; }
|
||||||
error() { echo -e "${RED}[错误]${NC} $1"; exit 1; }
|
error() { echo -e "${RED}[错误]${NC} $1"; exit 1; }
|
||||||
|
|
||||||
|
systemd_env_escape() {
|
||||||
|
local value="$1"
|
||||||
|
|
||||||
|
value="${value//\\/\\\\}"
|
||||||
|
value="${value//\"/\\\"}"
|
||||||
|
value="${value//%/%%}"
|
||||||
|
printf '%s' "$value"
|
||||||
|
}
|
||||||
|
|
||||||
download_repo_archive() {
|
download_repo_archive() {
|
||||||
local output_file=$1
|
local output_file=$1
|
||||||
|
|
||||||
@@ -1096,11 +1106,21 @@ install_driver_manager() {
|
|||||||
chmod +x "$install_dir/driver_manager.py"
|
chmod +x "$install_dir/driver_manager.py"
|
||||||
|
|
||||||
# 生成随机密码
|
# 生成随机密码
|
||||||
|
local admin_user="${DRIVER_MANAGER_USERNAME:-admin}"
|
||||||
local admin_pass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8)
|
local admin_pass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8)
|
||||||
|
local service_user
|
||||||
|
local service_pass
|
||||||
|
service_user=$(systemd_env_escape "$admin_user")
|
||||||
|
service_pass=$(systemd_env_escape "$admin_pass")
|
||||||
|
|
||||||
# 更新 systemd 服务文件中的密码
|
# 更新 systemd 服务文件中的密码
|
||||||
if [ -f /etc/systemd/system/cups-driver-manager.service ]; then
|
if [ -f /etc/systemd/system/cups-driver-manager.service ]; then
|
||||||
sed -i "s/DRIVER_MANAGER_PASSWORD=.*/DRIVER_MANAGER_PASSWORD=$admin_pass/" /etc/systemd/system/cups-driver-manager.service
|
if grep -q "DRIVER_MANAGER_USERNAME" /etc/systemd/system/cups-driver-manager.service; then
|
||||||
|
sed -i "s/^Environment=.*DRIVER_MANAGER_USERNAME=.*/Environment=\"DRIVER_MANAGER_USERNAME=$service_user\"/" /etc/systemd/system/cups-driver-manager.service
|
||||||
|
else
|
||||||
|
sed -i "/DRIVER_MANAGER_PASSWORD=/i Environment=\"DRIVER_MANAGER_USERNAME=$service_user\"" /etc/systemd/system/cups-driver-manager.service
|
||||||
|
fi
|
||||||
|
sed -i "s/^Environment=.*DRIVER_MANAGER_PASSWORD=.*/Environment=\"DRIVER_MANAGER_PASSWORD=$service_pass\"/" /etc/systemd/system/cups-driver-manager.service
|
||||||
sed -i "s#^ExecStart=.*#ExecStart=/usr/bin/python3 $install_dir/driver_manager.py --host $DRIVER_MANAGER_HOST --port 632#" /etc/systemd/system/cups-driver-manager.service
|
sed -i "s#^ExecStart=.*#ExecStart=/usr/bin/python3 $install_dir/driver_manager.py --host $DRIVER_MANAGER_HOST --port 632#" /etc/systemd/system/cups-driver-manager.service
|
||||||
if grep -q "DRIVER_MANAGER_ALLOW_PRIVATE_ONLY" /etc/systemd/system/cups-driver-manager.service; then
|
if grep -q "DRIVER_MANAGER_ALLOW_PRIVATE_ONLY" /etc/systemd/system/cups-driver-manager.service; then
|
||||||
sed -i "s/DRIVER_MANAGER_ALLOW_PRIVATE_ONLY=.*/DRIVER_MANAGER_ALLOW_PRIVATE_ONLY=$DRIVER_MANAGER_PRIVATE_ONLY/" /etc/systemd/system/cups-driver-manager.service
|
sed -i "s/DRIVER_MANAGER_ALLOW_PRIVATE_ONLY=.*/DRIVER_MANAGER_ALLOW_PRIVATE_ONLY=$DRIVER_MANAGER_PRIVATE_ONLY/" /etc/systemd/system/cups-driver-manager.service
|
||||||
@@ -1122,7 +1142,8 @@ WorkingDirectory=$install_dir
|
|||||||
ExecStart=/usr/bin/python3 $install_dir/driver_manager.py --host $DRIVER_MANAGER_HOST --port 632
|
ExecStart=/usr/bin/python3 $install_dir/driver_manager.py --host $DRIVER_MANAGER_HOST --port 632
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
Environment=DRIVER_MANAGER_PASSWORD=$admin_pass
|
Environment="DRIVER_MANAGER_USERNAME=$service_user"
|
||||||
|
Environment="DRIVER_MANAGER_PASSWORD=$service_pass"
|
||||||
Environment=DRIVER_MANAGER_ALLOW_PRIVATE_ONLY=$DRIVER_MANAGER_PRIVATE_ONLY
|
Environment=DRIVER_MANAGER_ALLOW_PRIVATE_ONLY=$DRIVER_MANAGER_PRIVATE_ONLY
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
@@ -1135,17 +1156,159 @@ EOF
|
|||||||
systemctl enable cups-driver-manager
|
systemctl enable cups-driver-manager
|
||||||
systemctl restart cups-driver-manager
|
systemctl restart cups-driver-manager
|
||||||
|
|
||||||
# 保存密码到文件
|
# 保存账号密码到文件
|
||||||
|
echo "$admin_user" > "$install_dir/.username"
|
||||||
echo "$admin_pass" > "$install_dir/.password"
|
echo "$admin_pass" > "$install_dir/.password"
|
||||||
|
chmod 600 "$install_dir/.username"
|
||||||
chmod 600 "$install_dir/.password"
|
chmod 600 "$install_dir/.password"
|
||||||
|
|
||||||
success "驱动管理器安装完成"
|
success "驱动管理器安装完成"
|
||||||
|
info "驱动管理器用户名: $admin_user"
|
||||||
info "驱动管理器密码: $admin_pass"
|
info "驱动管理器密码: $admin_pass"
|
||||||
|
|
||||||
# 导出变量供后续使用
|
# 导出变量供后续使用
|
||||||
|
DRIVER_MANAGER_USERNAME="$admin_user"
|
||||||
DRIVER_MANAGER_PASSWORD="$admin_pass"
|
DRIVER_MANAGER_PASSWORD="$admin_pass"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_driver_manager_env_value() {
|
||||||
|
local key="$1"
|
||||||
|
|
||||||
|
systemctl cat cups-driver-manager 2>/dev/null | \
|
||||||
|
sed -n "s/^[[:space:]]*Environment=\"\?$key=\\([^\" ]*\\)\"\\?.*/\\1/p" | tail -n1
|
||||||
|
}
|
||||||
|
|
||||||
|
get_driver_manager_username() {
|
||||||
|
if [ -f /opt/cups-driver-manager/.username ]; then
|
||||||
|
cat /opt/cups-driver-manager/.username 2>/dev/null
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local value
|
||||||
|
value="$(get_driver_manager_env_value DRIVER_MANAGER_USERNAME)"
|
||||||
|
echo "${value:-admin}"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_driver_manager_password() {
|
||||||
|
if [ -f /opt/cups-driver-manager/.password ]; then
|
||||||
|
cat /opt/cups-driver-manager/.password 2>/dev/null
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
get_driver_manager_env_value DRIVER_MANAGER_PASSWORD
|
||||||
|
}
|
||||||
|
|
||||||
|
generate_driver_manager_password() {
|
||||||
|
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 12
|
||||||
|
}
|
||||||
|
|
||||||
|
validate_driver_manager_username() {
|
||||||
|
local username="$1"
|
||||||
|
|
||||||
|
[ -n "$username" ] || return 1
|
||||||
|
case "$username" in
|
||||||
|
*:*|*[[:space:]]*) return 1 ;;
|
||||||
|
esac
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
write_driver_manager_auth() {
|
||||||
|
local username="$1"
|
||||||
|
local password="$2"
|
||||||
|
local install_dir="/opt/cups-driver-manager"
|
||||||
|
local dropin_dir="/etc/systemd/system/cups-driver-manager.service.d"
|
||||||
|
local dropin_file="$dropin_dir/auth.conf"
|
||||||
|
local service_user
|
||||||
|
local service_pass
|
||||||
|
|
||||||
|
service_user=$(systemd_env_escape "$username")
|
||||||
|
service_pass=$(systemd_env_escape "$password")
|
||||||
|
|
||||||
|
mkdir -p "$install_dir" "$dropin_dir"
|
||||||
|
cat > "$dropin_file" << EOF
|
||||||
|
[Service]
|
||||||
|
Environment="DRIVER_MANAGER_USERNAME=$service_user"
|
||||||
|
Environment="DRIVER_MANAGER_PASSWORD=$service_pass"
|
||||||
|
EOF
|
||||||
|
chmod 600 "$dropin_file"
|
||||||
|
|
||||||
|
echo "$username" > "$install_dir/.username"
|
||||||
|
echo "$password" > "$install_dir/.password"
|
||||||
|
chmod 600 "$install_dir/.username" "$install_dir/.password"
|
||||||
|
}
|
||||||
|
|
||||||
|
change_driver_manager_auth() {
|
||||||
|
echo ""
|
||||||
|
echo -e "${YELLOW}═══════════════════════════════════════════════════════════${NC}"
|
||||||
|
echo -e "${YELLOW} 修改驱动管理器用户名和密码 ${NC}"
|
||||||
|
echo -e "${YELLOW}═══════════════════════════════════════════════════════════${NC}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
check_root
|
||||||
|
|
||||||
|
if ! systemctl cat cups-driver-manager >/dev/null 2>&1; then
|
||||||
|
error "未检测到 cups-driver-manager 服务,请先安装驱动管理器"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local current_username
|
||||||
|
local current_password
|
||||||
|
local new_username
|
||||||
|
local new_password
|
||||||
|
local confirm_password
|
||||||
|
|
||||||
|
current_username="$(get_driver_manager_username)"
|
||||||
|
current_password="$(get_driver_manager_password)"
|
||||||
|
|
||||||
|
echo -e "${BLUE}当前配置:${NC}"
|
||||||
|
echo " 服务: cups-driver-manager"
|
||||||
|
echo " 用户名: ${current_username:-admin}"
|
||||||
|
if [ -n "$current_password" ]; then
|
||||||
|
echo " 密码: 已存在(留空可保持不变)"
|
||||||
|
else
|
||||||
|
echo " 密码: 未找到保存记录(留空将自动生成新密码)"
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
read -p "请输入新用户名 [${current_username:-admin}]: " new_username < /dev/tty
|
||||||
|
new_username="${new_username:-${current_username:-admin}}"
|
||||||
|
if ! validate_driver_manager_username "$new_username"; then
|
||||||
|
error "用户名不能为空,且不能包含空格或冒号"
|
||||||
|
fi
|
||||||
|
|
||||||
|
read -s -p "请输入新密码(留空保持当前密码): " new_password < /dev/tty
|
||||||
|
echo ""
|
||||||
|
if [ -n "$new_password" ]; then
|
||||||
|
read -s -p "请再次输入新密码: " confirm_password < /dev/tty
|
||||||
|
echo ""
|
||||||
|
if [ "$new_password" != "$confirm_password" ]; then
|
||||||
|
error "两次输入的密码不一致"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -n "$current_password" ]; then
|
||||||
|
new_password="$current_password"
|
||||||
|
else
|
||||||
|
new_password="$(generate_driver_manager_password)"
|
||||||
|
warn "未输入密码,已自动生成随机密码"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
write_driver_manager_auth "$new_username" "$new_password"
|
||||||
|
|
||||||
|
info "重载 systemd 并重启驱动管理器..."
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart cups-driver-manager
|
||||||
|
|
||||||
|
if systemctl is-active --quiet cups-driver-manager; then
|
||||||
|
success "驱动管理器账号密码已更新"
|
||||||
|
echo ""
|
||||||
|
echo -e " ${GREEN}用户名:${NC} $new_username"
|
||||||
|
echo -e " ${GREEN}密码:${NC} $new_password"
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
error "驱动管理器重启失败,请运行 systemctl status cups-driver-manager 查看原因"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# 安装网络和打印服务守护脚本
|
# 安装网络和打印服务守护脚本
|
||||||
install_watchdogs() {
|
install_watchdogs() {
|
||||||
info "安装 CUPS 守护脚本..."
|
info "安装 CUPS 守护脚本..."
|
||||||
@@ -1598,11 +1761,12 @@ main() {
|
|||||||
echo ""
|
echo ""
|
||||||
# 检查是否安装了驱动管理器
|
# 检查是否安装了驱动管理器
|
||||||
if systemctl is-active cups-driver-manager >/dev/null 2>&1; then
|
if systemctl is-active cups-driver-manager >/dev/null 2>&1; then
|
||||||
|
local dm_user=$(get_driver_manager_username 2>/dev/null || echo "admin")
|
||||||
local dm_pass=$(cat /opt/cups-driver-manager/.password 2>/dev/null || echo "admin")
|
local dm_pass=$(cat /opt/cups-driver-manager/.password 2>/dev/null || echo "admin")
|
||||||
echo -e " ${GREEN}┌─────────────────────────────────────────────────────┐${NC}"
|
echo -e " ${GREEN}┌─────────────────────────────────────────────────────┐${NC}"
|
||||||
echo -e " ${GREEN}│${NC} ${YELLOW}驱动管理器 (上传安装驱动)${NC} ${GREEN}│${NC}"
|
echo -e " ${GREEN}│${NC} ${YELLOW}驱动管理器 (上传安装驱动)${NC} ${GREEN}│${NC}"
|
||||||
echo -e " ${GREEN}│${NC} 地址: http://${LOCAL_IP}:632 ${GREEN}│${NC}"
|
echo -e " ${GREEN}│${NC} 地址: http://${LOCAL_IP}:632 ${GREEN}│${NC}"
|
||||||
echo -e " ${GREEN}│${NC} ${RED}用户名: admin${NC} ${GREEN}│${NC}"
|
echo -e " ${GREEN}│${NC} ${RED}用户名: ${dm_user}${NC} ${GREEN}│${NC}"
|
||||||
echo -e " ${GREEN}│${NC} ${RED}密码: ${dm_pass}${NC} ${GREEN}│${NC}"
|
echo -e " ${GREEN}│${NC} ${RED}密码: ${dm_pass}${NC} ${GREEN}│${NC}"
|
||||||
echo -e " ${GREEN}│${NC} ${YELLOW}(注意:不是SSH密码,仅允许内网访问)${NC} ${GREEN}│${NC}"
|
echo -e " ${GREEN}│${NC} ${YELLOW}(注意:不是SSH密码,仅允许内网访问)${NC} ${GREEN}│${NC}"
|
||||||
echo -e " ${GREEN}└─────────────────────────────────────────────────────┘${NC}"
|
echo -e " ${GREEN}└─────────────────────────────────────────────────────┘${NC}"
|
||||||
@@ -1846,6 +2010,8 @@ show_help() {
|
|||||||
echo " $0 显示主菜单"
|
echo " $0 显示主菜单"
|
||||||
echo " $0 --install 直接安装 CUPS 打印服务"
|
echo " $0 --install 直接安装 CUPS 打印服务"
|
||||||
echo " $0 --uninstall 直接卸载 CUPS 打印服务"
|
echo " $0 --uninstall 直接卸载 CUPS 打印服务"
|
||||||
|
echo " $0 --driver-manager-auth"
|
||||||
|
echo " 修改驱动管理器用户名和密码"
|
||||||
echo " $0 --help 显示此帮助信息"
|
echo " $0 --help 显示此帮助信息"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
@@ -1956,9 +2122,10 @@ show_menu() {
|
|||||||
echo " 4) 切换为静态 IP(固定当前 IP)"
|
echo " 4) 切换为静态 IP(固定当前 IP)"
|
||||||
echo " 5) 查看当前网络状态(静态/DHCP)"
|
echo " 5) 查看当前网络状态(静态/DHCP)"
|
||||||
echo " 6) 一键共享所有打印机"
|
echo " 6) 一键共享所有打印机"
|
||||||
|
echo " 7) 修改驱动管理器用户名和密码"
|
||||||
echo " 0) 退出"
|
echo " 0) 退出"
|
||||||
echo ""
|
echo ""
|
||||||
read -p " 请输入选项 [0-6]: " choice < /dev/tty
|
read -p " 请输入选项 [0-7]: " choice < /dev/tty
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
1)
|
1)
|
||||||
@@ -1995,6 +2162,12 @@ show_menu() {
|
|||||||
read -p "按 Enter 返回主菜单..." < /dev/tty
|
read -p "按 Enter 返回主菜单..." < /dev/tty
|
||||||
show_menu
|
show_menu
|
||||||
;;
|
;;
|
||||||
|
7)
|
||||||
|
change_driver_manager_auth
|
||||||
|
echo ""
|
||||||
|
read -p "按 Enter 返回主菜单..." < /dev/tty
|
||||||
|
show_menu
|
||||||
|
;;
|
||||||
0)
|
0)
|
||||||
echo "已退出"
|
echo "已退出"
|
||||||
exit 0
|
exit 0
|
||||||
@@ -2015,6 +2188,9 @@ case "${1:-}" in
|
|||||||
--install|-i)
|
--install|-i)
|
||||||
main
|
main
|
||||||
;;
|
;;
|
||||||
|
--driver-manager-auth|--dm-auth)
|
||||||
|
change_driver_manager_auth
|
||||||
|
;;
|
||||||
--help|-h)
|
--help|-h)
|
||||||
show_help
|
show_help
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user