mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-24 12:15:01 +00:00
Every interactive prompt takes a var_<app>_<name> override and treats a closed stdin like Enter (`|| true`), so an install keeps going after the console that started it is gone. Values the script cannot do without end with exit 64 and name the variable to set. Validation loops stop asking when nobody can answer instead of spinning on an empty read.
53 lines
1.5 KiB
Bash
53 lines
1.5 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 tteck
|
|
# Author: tteck
|
|
# Co-Author: havardthom
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://github.com/cockpit-project/cockpit
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
color
|
|
verb_ip6
|
|
catch_errors
|
|
setting_up_container
|
|
network_check
|
|
update_os
|
|
|
|
msg_info "Installing Cockpit"
|
|
CODENAME=$(get_os_info codename)
|
|
cat <<EOF >/etc/apt/sources.list.d/debian-backports.sources
|
|
Types: deb deb-src
|
|
URIs: http://deb.debian.org/debian
|
|
Suites: ${CODENAME}-backports
|
|
Components: main
|
|
Enabled: yes
|
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
|
EOF
|
|
|
|
apt_update_safe
|
|
$STD apt install -t ${CODENAME}-backports cockpit cracklib-runtime --no-install-recommends -y
|
|
sed -i "s/root//g" /etc/cockpit/disallowed-users
|
|
msg_ok "Installed Cockpit"
|
|
|
|
# 45Drives only publishes amd64 packages
|
|
if [[ "$(arch_resolve)" != "arm64" ]]; then
|
|
prompt="${var_cockpit_45drives:-}"
|
|
[[ -n "$prompt" ]] || read -r -p "Would you like to install 45Drives' cockpit-file-sharing, cockpit-identities, and cockpit-navigator <y/N> " prompt || true
|
|
fi
|
|
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
|
msg_info "Installing 45Drives' cockpit extensions"
|
|
setup_deb822_repo "45drives" \
|
|
"https://repo.45drives.com/key/gpg.asc" \
|
|
"https://repo.45drives.com/enterprise/debian" \
|
|
"${CODENAME}" \
|
|
"main" \
|
|
"amd64"
|
|
$STD apt install -y cockpit-file-sharing cockpit-identities cockpit-navigator
|
|
msg_ok "Installed 45Drives' cockpit extensions"
|
|
fi
|
|
|
|
motd_ssh
|
|
customize
|
|
cleanup_lxc
|