Skip to content

Commit 53f3975

Browse files
authored
Update cockpit-install.sh (#8346)
1 parent f303b5e commit 53f3975

File tree

2 files changed

+44
-69
lines changed

2 files changed

+44
-69
lines changed

ct/cockpit.sh

Lines changed: 6 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -27,73 +27,12 @@ function update_script() {
2727
msg_error "No ${APP} Installation Found!"
2828
exit
2929
fi
30-
UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 4 \
31-
"1" "Update LXC" ON \
32-
"2" "Install cockpit-file-sharing" OFF \
33-
"3" "Install cockpit-identities" OFF \
34-
"4" "Install cockpit-navigator" OFF \
35-
3>&1 1>&2 2>&3)
36-
37-
if [ "$UPD" == "1" ]; then
38-
msg_info "Updating ${APP} LXC"
39-
$STD apt update
40-
$STD apt -y upgrade
41-
msg_ok "Updated ${APP} LXC"
42-
exit
43-
fi
44-
45-
if [ "$UPD" == "2" ]; then
46-
msg_info "Installing dependencies (patience)"
47-
$STD apt install -y \
48-
attr \
49-
nfs-kernel-server \
50-
samba \
51-
samba-common-bin \
52-
winbind \
53-
gawk
54-
msg_ok "Installed dependencies"
55-
msg_info "Installing Cockpit file sharing"
56-
URL=$(curl -fsSL https://api.github.com/repos/45Drives/cockpit-file-sharing/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)
57-
FILE=$(basename "$URL")
58-
curl -fsSL "$URL" -o "$FILE"
59-
$STD dpkg -i "$FILE" || $STD apt install -f -y
60-
rm -f "$FILE"
61-
msg_ok "Installed Cockpit file sharing"
62-
exit
63-
fi
64-
65-
if [ "$UPD" == "3" ]; then
66-
msg_info "Installing dependencies (patience)"
67-
$STD apt install -y \
68-
psmisc \
69-
samba \
70-
samba-common-bin
71-
msg_ok "Installed dependencies"
72-
msg_info "Installing Cockpit identities"
73-
URL=$(curl -fsSL https://api.github.com/repos/45Drives/cockpit-identities/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)
74-
FILE=$(basename "$URL")
75-
curl -fsSL "$URL" -o "$FILE"
76-
$STD dpkg -i "$FILE" || $STD apt install -f -y
77-
rm -f "$FILE"
78-
msg_ok "Installed Cockpit identities"
79-
exit
80-
fi
81-
82-
if [ "$UPD" == "4" ]; then
83-
msg_info "Installing dependencies"
84-
$STD apt install -y \
85-
rsync \
86-
zip
87-
msg_ok "Installed dependencies"
88-
msg_info "Installing Cockpit navigator"
89-
URL=$(curl -fsSL https://api.github.com/repos/45Drives/cockpit-navigator/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)
90-
FILE=$(basename "$URL")
91-
curl -fsSL "$URL" -o "$FILE"
92-
$STD dpkg -i "$FILE" || $STD apt install -f -y
93-
rm -f "$FILE"
94-
msg_ok "Installed Cockpit navigator"
95-
exit
96-
fi
30+
31+
msg_info "Updating ${APP} LXC"
32+
$STD apt update
33+
$STD apt -y upgrade
34+
msg_ok "Updated ${APP} LXC"
35+
exit
9736
}
9837

9938
start

install/cockpit-install.sh

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,48 @@ update_os
1616

1717
msg_info "Installing Cockpit"
1818
source /etc/os-release
19-
echo "deb http://deb.debian.org/debian ${VERSION_CODENAME}-backports main" >/etc/apt/sources.list.d/backports.list
19+
20+
cat <<EOF >/etc/apt/sources.list.d/debian-backports.sources
21+
Types: deb deb-src
22+
URIs: http://deb.debian.org/debian
23+
Suites: ${VERSION_CODENAME}-backports
24+
Components: main
25+
Enabled: yes
26+
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
27+
EOF
28+
2029
$STD apt update
21-
$STD apt install -t ${VERSION_CODENAME}-backports cockpit --no-install-recommends -y
30+
$STD apt install -t ${VERSION_CODENAME}-backports cockpit cracklib-runtime --no-install-recommends -y
2231
sed -i "s/root//g" /etc/cockpit/disallowed-users
2332
msg_ok "Installed Cockpit"
2433

34+
read -r -p "Would you like to install 45Drives' cockpit-file-sharing, cockpit-identities, and cockpit-navigator <y/N> " prompt
35+
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
36+
install_45drives=true
37+
if [[ "${VERSION_ID}" -ge 13 ]]; then
38+
read -r -p "Debian ${VERSION_ID} is not officially supported by 45Drives yet, would you like to continue anyway? <y/N> " prompt
39+
if [[ ! "${prompt,,}" =~ ^(y|yes)$ ]]; then
40+
install_45drives=false
41+
fi
42+
fi
43+
if [[ "$install_45drives" == "true" ]]; then
44+
msg_info "Installing 45Drives' cockpit extensions"
45+
curl -fsSL https://repo.45drives.com/key/gpg.asc | gpg --pinentry-mode loopback --batch --yes --dearmor -o /usr/share/keyrings/45drives-archive-keyring.gpg
46+
cat <<EOF >/etc/apt/sources.list.d/45drives-enterprise.sources
47+
Types: deb
48+
URIs: https://repo.45drives.com/enterprise/debian
49+
Suites: bookworm
50+
Components: main
51+
Architectures: amd64
52+
Signed-By: /usr/share/keyrings/45drives-archive-keyring.gpg
53+
EOF
54+
55+
$STD apt update
56+
$STD apt install cockpit-file-sharing cockpit-identities cockpit-navigator -y
57+
msg_ok "Installed 45Drives' cockpit extensions"
58+
fi
59+
fi
60+
2561
motd_ssh
2662
customize
2763

0 commit comments

Comments
 (0)