Skip to content

Commit a35dad5

Browse files
authored
Fix optional installs in Cockpit LXC (#317)
1 parent 61d2e0d commit a35dad5

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

ct/cockpit.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ if [ "$UPD" == "2" ]; then
8080
apt-get install -y gawk &>/dev/null
8181
msg_ok "Installed dependencies"
8282
msg_info "Installing Cockpit file sharing"
83-
LATEST=$(curl -s https://api.github.com/repos/45Drives/cockpit-file-sharing/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
84-
wget -q https://github.com/45Drives/cockpit-file-sharing/releases/download/v${LATEST}/cockpit-file-sharing_${LATEST}-1focal_all.deb
85-
dpkg -i cockpit-file-sharing_${LATEST}-1focal_all.deb &>/dev/null
86-
rm cockpit-file-sharing_${LATEST}-1focal_all.deb
83+
wget -q $(curl -s https://api.github.com/repos/45Drives/cockpit-file-sharing/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)
84+
dpkg -i cockpit-file-sharing_*focal_all.deb &>/dev/null
85+
rm cockpit-file-sharing_*focal_all.deb
8786
msg_ok "Installed Cockpit file sharing"
8887
exit
8988
fi
@@ -94,10 +93,9 @@ if [ "$UPD" == "3" ]; then
9493
apt-get install -y samba-common-bin &>/dev/null
9594
msg_ok "Installed dependencies"
9695
msg_info "Installing Cockpit identities"
97-
LATEST=$(curl -s https://api.github.com/repos/45Drives/cockpit-identities/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
98-
wget -q https://github.com/45Drives/cockpit-identities/releases/download/v${LATEST}/cockpit-identities_${LATEST}-1focal_all.deb
99-
dpkg -i cockpit-identities_${LATEST}-1focal_all.deb &>/dev/null
100-
rm cockpit-identities_${LATEST}-1focal_all.deb
96+
wget -q $(curl -s https://api.github.com/repos/45Drives/cockpit-identities/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)
97+
dpkg -i cockpit-identities_*focal_all.deb &>/dev/null
98+
rm cockpit-identities_*focal_all.deb
10199
msg_ok "Installed Cockpit identities"
102100
exit
103101
fi
@@ -107,10 +105,9 @@ if [ "$UPD" == "4" ]; then
107105
apt-get install -y zip &>/dev/null
108106
msg_ok "Installed dependencies"
109107
msg_info "Installing Cockpit navigator"
110-
LATEST=$(curl -s https://api.github.com/repos/45Drives/cockpit-navigator/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
111-
wget -q https://github.com/45Drives/cockpit-navigator/releases/download/v${LATEST}/cockpit-navigator_${LATEST}-1focal_all.deb
112-
dpkg -i cockpit-navigator_${LATEST}-1focal_all.deb &>/dev/null
113-
rm cockpit-navigator_${LATEST}-1focal_all.deb
108+
wget -q $(curl -s https://api.github.com/repos/45Drives/cockpit-navigator/releases/latest | grep download | grep focal_all.deb | cut -d\" -f4)
109+
dpkg -i cockpit-navigator_*focal_all.deb &>/dev/null
110+
rm cockpit-navigator_*focal_all.deb
114111
msg_ok "Installed Cockpit navigator"
115112
exit
116113
fi

0 commit comments

Comments
 (0)