This commit is contained in:
Slaviša Arežina 2025-07-29 14:53:08 +02:00 committed by GitHub
parent 6450c3c6a4
commit 5597f7fc41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 18 deletions

View File

@ -27,26 +27,19 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
RELEASE=$(curl -fsSL https://api.github.com/repos/inspircd/inspircd/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/inspircd/inspircd/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then if [[ "${RELEASE}" != "$(cat ~/.inspircd 2>/dev/null)" ]] || [[ ! -f ~/.inspircd ]]; then
msg_info "Stopping Service" msg_info "Stopping Service"
systemctl stop inspircd systemctl stop inspircd
msg_ok "Stopped Service" msg_ok "Stopped Service"
msg_info "Updating ${APP} to v${RELEASE}" fetch_and_deploy_gh_release "inspircd" "inspircd/inspircd" "binary"
cd /opt
curl -fsSL "https://github.com/inspircd/inspircd/releases/download/v${RELEASE}/inspircd_${RELEASE}.deb12u2_amd64.deb" -o $(basename "https://github.com/inspircd/inspircd/releases/download/v${RELEASE}/inspircd_${RELEASE}.deb12u2_amd64.deb")
$STD apt-get install "./inspircd_${RELEASE}.deb12u2_amd64.deb" -y
echo "${RELEASE}" >"/opt/${APP}_version.txt"
msg_ok "Updated ${APP} to v${RELEASE}"
msg_info "Starting Service" msg_info "Starting Service"
systemctl start inspircd systemctl start inspircd
msg_ok "Started Service" msg_ok "Started Service"
msg_info "Cleaning up"
rm -rf /opt/inspircd_${RELEASE}.deb12u2_amd64.deb
msg_ok "Cleaned"
msg_ok "Updated Successfully" msg_ok "Updated Successfully"
else else
msg_ok "No update required. ${APP} is already at v${RELEASE}." msg_ok "No update required. ${APP} is already at v${RELEASE}."

View File

@ -13,11 +13,9 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Installing InspIRCd" fetch_and_deploy_gh_release "inspircd" "inspircd/inspircd" "binary"
RELEASE=$(curl -fsSL https://api.github.com/repos/inspircd/inspircd/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
cd /opt msg_info "Configuring InspIRCd"
curl -fsSL "https://github.com/inspircd/inspircd/releases/download/v${RELEASE}/inspircd_${RELEASE}.deb12u2_amd64.deb" -o "inspircd_${RELEASE}.deb12u2_amd64.deb"
$STD apt-get install "./inspircd_${RELEASE}.deb12u2_amd64.deb" -y &>/dev/null
cat <<EOF >/etc/inspircd/inspircd.conf cat <<EOF >/etc/inspircd/inspircd.conf
<define name="networkDomain" value="helper-scripts.com"> <define name="networkDomain" value="helper-scripts.com">
<define name="networkName" value="Proxmox VE Helper-Scripts"> <define name="networkName" value="Proxmox VE Helper-Scripts">
@ -32,15 +30,12 @@ cat <<EOF >/etc/inspircd/inspircd.conf
email="irc@&networkDomain;"> email="irc@&networkDomain;">
<bind address="" port="6667" type="clients"> <bind address="" port="6667" type="clients">
EOF EOF
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed InspIRCd" msg_ok "Installed InspIRCd"
motd_ssh motd_ssh
customize customize
msg_info "Cleaning up" msg_info "Cleaning up"
rm -rf /opt/inspircd_${RELEASE}.deb12u2_amd64.deb
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
msg_ok "Cleaned" msg_ok "Cleaned"