1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-04-30 14:43:06 +00:00
ProxmoxVE/install/cosmos-install.sh
CanbiZ 8c051b8186
Replace wget with curl -fsSL, normalize downloads, and prep for IPv6 (#3455)
* Initial Call, Switch from curl -s to curl -fsSL and wget to curl -fssL

* more switches

* switch vms

* more curls

* More curls

* more

* more

* more changes

* more

* prepare ipv6 calls

* change frontend to ipv6

* Formatting

* Fromatting

* Update gomft.sh

* Update gomft-install.sh

* Update ersatztv.sh

* Update build.func

---------

Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-04-01 10:25:46 +02:00

82 lines
2.4 KiB
Bash

#!/usr/bin/env bash
#Copyright (c) 2021-2025 community-scripts ORG
# Author: Michel Roegl-Brunner (michelroegl-brunner)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://https://cosmos-cloud.io/
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
snapraid \
avahi-daemon \
fdisk
msg_ok "Installed Dependencies"
msg_info "Install mergerfs"
MERGERFS_VERSION="2.40.2"
curl -fsSL "https://github.com/trapexit/mergerfs/releases/download/${MERGERFS_VERSION}/mergerfs_${MERGERFS_VERSION}.debian-bullseye_amd64.deb" -O $(basename "https://github.com/trapexit/mergerfs/releases/download/${MERGERFS_VERSION}/mergerfs_${MERGERFS_VERSION}.debian-bullseye_amd64.deb")
$STD dpkg -i "mergerfs_${MERGERFS_VERSION}.debian-bullseye_amd64.deb" || $STD apt-get install -f -y
rm "mergerfs_${MERGERFS_VERSION}.debian-bullseye_amd64.deb"
msg_ok "Installed mergerfs"
msg_info "Install Docker"
curl -fsSL https://get.docker.com -o get-docker.sh
$STD sh get-docker.sh
rm get-docker.sh
msg_ok "Installed Docker"
msg_info "Install Cosmos"
mkdir -p /opt/cosmos
LATEST_RELEASE=$(curl -fsSL https://api.github.com/repos/azukaar/Cosmos-Server/releases/latest | grep "tag_name" | cut -d '"' -f 4)
ZIP_FILE="cosmos-cloud-${LATEST_RELEASE#v}-amd64.zip"
curl -fsSLL "https://github.com/azukaar/Cosmos-Server/releases/download/${LATEST_RELEASE}/${ZIP_FILE}" -o "/opt/cosmos/${ZIP_FILE}"
cd /opt/cosmos
unzip -o -q "${ZIP_FILE}"
LATEST_RELEASE_NO_V=${LATEST_RELEASE#v}
mv /opt/cosmos/cosmos-cloud-${LATEST_RELEASE_NO_V}/* /opt/cosmos/
rmdir /opt/cosmos/cosmos-cloud-${LATEST_RELEASE_NO_V}
chmod +x /opt/cosmos/cosmos
msg_ok "Installed Cosmos"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/cosmos.service
[Unit]
Description=Cosmos Cloud service
ConditionFileIsExecutable=/opt/cosmos/start.sh
[Service]
StartLimitInterval=10
StartLimitBurst=5
ExecStart=/opt/cosmos/start.sh
WorkingDirectory=/opt/cosmos
Restart=always
RestartSec=2
EnvironmentFile=-/etc/sysconfig/CosmosCloud
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now cosmos.service
msg_info "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
rm -f "/opt/cosmos/cosmos-cloud-${LATEST_RELEASE#v}-amd64.zip"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"