Merge branch 'main' of https://github.com/GoldenSpringness/ProxmoxVED into feature/sonobarr
updating code
This commit is contained in:
commit
a0e6da9ddc
64
ct/rustypaste.sh
Normal file
64
ct/rustypaste.sh
Normal file
@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: GoldenSpringness
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/orhun/rustypaste
|
||||
|
||||
APP="rustypaste"
|
||||
var_tags="${var_tags:-pastebin;storage}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-20}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f "/opt/rustypaste/target/release/rustypaste" ]]; then
|
||||
msg_error "No rustypaste Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "rustypaste" "orhun/rustypaste"; then
|
||||
msg_info "Stopping rustypaste"
|
||||
systemctl stop rustypaste
|
||||
msg_ok "Stopped rustypaste"
|
||||
|
||||
msg_info "Creating Backup"
|
||||
tar -czf "/opt/rustypaste_backup_$(date +%F).tar.gz" "/opt/rustypaste/upload"
|
||||
msg_ok "Backup Created"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "tarball" "latest" "/opt/rustypaste"
|
||||
|
||||
msg_info "Updating rustypaste"
|
||||
cd /opt/rustypaste
|
||||
sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' config.toml
|
||||
$STD cargo build --locked --release
|
||||
msg_ok "Updated rustypaste"
|
||||
|
||||
msg_info "Starting rustypaste"
|
||||
systemctl start rustypaste
|
||||
msg_ok "Started rustypaste"
|
||||
msg_ok "Update Successful"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}rustypaste setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000${CL}"
|
||||
@ -8,11 +8,11 @@
|
||||
"type": "addon",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 9025,
|
||||
"interface_port": 9205,
|
||||
"documentation": "https://github.com/xperimental/nextcloud-exporter",
|
||||
"website": "https://github.com/xperimental/nextcloud-exporter",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/nextcloud.webp",
|
||||
"config_path": "/opt/nextcloud-exporter.env",
|
||||
"config_path": "/etc/nextcloud-exporter.env",
|
||||
"description": "Prometheus exporter for Nextcloud servers. ",
|
||||
"install_methods": [
|
||||
{
|
||||
@ -25,17 +25,6 @@
|
||||
"os": null,
|
||||
"version": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "alpine",
|
||||
"script": "tools/addon/nextcloud-exporter.sh",
|
||||
"resources": {
|
||||
"cpu": null,
|
||||
"ram": null,
|
||||
"hdd": null,
|
||||
"os": null,
|
||||
"version": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
|
||||
40
frontend/public/json/rustypaste.json
Normal file
40
frontend/public/json/rustypaste.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "RustyPaste",
|
||||
"slug": "rustypaste",
|
||||
"categories": [
|
||||
12
|
||||
],
|
||||
"date_created": "2025-12-22",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8000,
|
||||
"documentation": "https://github.com/orhun/rustypaste",
|
||||
"config_path": "/opt/rustypaste/config.toml",
|
||||
"website": "https://github.com/orhun/rustypaste",
|
||||
"logo": "https://github.com/orhun/rustypaste/raw/master/img/rustypaste_logo.png",
|
||||
"description": "Rustypaste is a minimal file upload/pastebin service.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/rustypaste.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 512,
|
||||
"hdd": 20,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "When updating the script it will backup the whole project including all the uploaded files, make sure to extract it to a safe location or remove",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -13,46 +13,47 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
libc6-dev \
|
||||
libpq-dev \
|
||||
clang \
|
||||
llvm \
|
||||
nettle-dev \
|
||||
build-essential \
|
||||
make
|
||||
msg_ok "Installed Dependencies"
|
||||
#msg_info "Installing Dependencies"
|
||||
#$STD apt-get install -y \
|
||||
# pkg-config \
|
||||
# libssl-dev \
|
||||
# libc6-dev \
|
||||
# libpq-dev \
|
||||
# clang \
|
||||
# llvm \
|
||||
# nettle-dev \
|
||||
# build-essential \
|
||||
# make
|
||||
#msg_ok "Installed Dependencies"
|
||||
|
||||
setup_rust
|
||||
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
|
||||
fetch_and_deploy_gh_release "hoodik" "hudikhq/hoodik" "tarball" "latest" "/opt/hoodik"
|
||||
#setup_rust
|
||||
#NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
|
||||
#fetch_and_deploy_gh_release "hoodik" "hudikhq/hoodik" "tarball" "latest" "/opt/hoodik"
|
||||
fetch_and_deploy_gh_release "hoodik" "hudikhq/hoodik" "prebuild" "latest" "/opt/hoodik" "*x86_64.tar.gz"
|
||||
|
||||
msg_info "Installing wasm-pack"
|
||||
$STD cargo install wasm-pack
|
||||
msg_ok "Installed wasm-pack"
|
||||
#msg_info "Installing wasm-pack"
|
||||
#$STD cargo install wasm-pack
|
||||
#msg_ok "Installed wasm-pack"
|
||||
|
||||
msg_info "Building Hoodik Frontend"
|
||||
cd /opt/hoodik
|
||||
$STD yarn install --frozen-lockfile
|
||||
$STD yarn wasm-pack
|
||||
$STD yarn web:build
|
||||
msg_ok "Built Hoodik Frontend"
|
||||
#msg_info "Building Hoodik Frontend"
|
||||
#cd /opt/hoodik
|
||||
#$STD yarn install --frozen-lockfile
|
||||
#$STD yarn wasm-pack
|
||||
#$STD yarn web:build
|
||||
#msg_ok "Built Hoodik Frontend"
|
||||
|
||||
msg_info "Building Hoodik Backend"
|
||||
cd /opt/hoodik
|
||||
$STD cargo build --release
|
||||
cp /opt/hoodik/target/release/hoodik /usr/local/bin/hoodik
|
||||
chmod +x /usr/local/bin/hoodik
|
||||
msg_ok "Built Hoodik Backend"
|
||||
#msg_info "Building Hoodik Backend"
|
||||
#cd /opt/hoodik
|
||||
#$STD cargo build --release
|
||||
#cp /opt/hoodik/target/release/hoodik /usr/local/bin/hoodik
|
||||
#chmod +x /usr/local/bin/hoodik
|
||||
#msg_ok "Built Hoodik Backend"
|
||||
|
||||
msg_info "Cleaning up build artifacts"
|
||||
rm -rf /opt/hoodik/target
|
||||
rm -rf /root/.cargo/registry
|
||||
rm -rf /opt/hoodik/node_modules
|
||||
msg_ok "Cleaned up build artifacts"
|
||||
#msg_info "Cleaning up build artifacts"
|
||||
#rm -rf /opt/hoodik/target
|
||||
#rm -rf /root/.cargo/registry
|
||||
#rm -rf /opt/hoodik/node_modules
|
||||
#msg_ok "Cleaned up build artifacts"
|
||||
|
||||
msg_info "Configuring Hoodik"
|
||||
mkdir -p /opt/hoodik_data
|
||||
@ -80,7 +81,8 @@ Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/hoodik_data
|
||||
EnvironmentFile=/opt/hoodik/.env
|
||||
ExecStart=/usr/local/bin/hoodik
|
||||
#ExecStart=/usr/local/bin/hoodik
|
||||
ExecStart=/opt/hoodik
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
|
||||
48
install/rustypaste-install.sh
Normal file
48
install/rustypaste-install.sh
Normal file
@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: GoldenSpringness
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/orhun/rustypaste
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y build-essential
|
||||
msg_ok "Dependencies Installed Successfully"
|
||||
|
||||
RUST_VERSION="1.92.0" setup_rust
|
||||
fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "tarball"
|
||||
|
||||
msg_info "Setting up rustypaste"
|
||||
cd /opt/rustypaste
|
||||
sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' config.toml
|
||||
$STD cargo build --locked --release
|
||||
msg_ok "Set up rustypaste"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/rustypaste.service
|
||||
[Unit]
|
||||
Description=rustypaste Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/opt/rustypaste
|
||||
ExecStart=/opt/rustypaste/target/release/rustypaste
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now rustypaste
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -3728,7 +3728,7 @@ create_lxc_container() {
|
||||
case "$PCT_OSTYPE" in
|
||||
debian | ubuntu | devuan) TEMPLATE_PATTERN="-standard_" ;;
|
||||
alpine | fedora | rocky | rockylinux | centos | almalinux | openeuler) TEMPLATE_PATTERN="-default_" ;;
|
||||
gentoo) TEMPLATE_PATTERN="-current_" ;;
|
||||
gentoo) TEMPLATE_PATTERN="-current-openrc" ;;
|
||||
opensuse) TEMPLATE_PATTERN="-default_" ;;
|
||||
*) TEMPLATE_PATTERN="" ;;
|
||||
esac
|
||||
|
||||
@ -523,8 +523,11 @@ msg_info() {
|
||||
if ! declare -p MSG_INFO_SHOWN &>/dev/null || ! declare -A MSG_INFO_SHOWN &>/dev/null; then
|
||||
declare -gA MSG_INFO_SHOWN=()
|
||||
fi
|
||||
[[ -n "${MSG_INFO_SHOWN["$msg"]+x}" ]] && return
|
||||
MSG_INFO_SHOWN["$msg"]=1
|
||||
# Sanitize message for use as associative array key (remove ANSI codes)
|
||||
local sanitized_msg
|
||||
sanitized_msg=$(printf '%s' "$msg" | sed 's/\x1b\[[0-9;]*m//g')
|
||||
[[ -n "${MSG_INFO_SHOWN["$sanitized_msg"]+x}" ]] && return
|
||||
MSG_INFO_SHOWN["$sanitized_msg"]=1
|
||||
|
||||
stop_spinner
|
||||
SPINNER_MSG="$msg"
|
||||
@ -569,7 +572,10 @@ msg_ok() {
|
||||
stop_spinner
|
||||
clear_line
|
||||
echo -e "$CM ${GN}${msg}${CL}"
|
||||
unset MSG_INFO_SHOWN["$msg"]
|
||||
# Sanitize message for use as associative array key (remove ANSI codes)
|
||||
local sanitized_msg
|
||||
sanitized_msg=$(printf '%s' "$msg" | sed 's/\x1b\[[0-9;]*m//g')
|
||||
unset MSG_INFO_SHOWN["$sanitized_msg"]
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
@ -867,7 +867,7 @@ customize() {
|
||||
cat >/etc/systemd/system/console-getty.service.d/override.conf <<'EOF'
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud 115200,38400,9600 $TERM
|
||||
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud 115200,38400,9600 - $TERM
|
||||
EOF
|
||||
# Enable console-getty for LXC web console (required on Fedora/RHEL)
|
||||
systemctl enable console-getty.service &>/dev/null || true
|
||||
@ -879,7 +879,7 @@ EOF
|
||||
cat >/etc/systemd/system/container-getty@1.service.d/override.conf <<'EOF'
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 $TERM
|
||||
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 - $TERM
|
||||
EOF
|
||||
fi
|
||||
|
||||
@ -898,9 +898,10 @@ EOF
|
||||
;;
|
||||
|
||||
sysvinit)
|
||||
# Devuan/older systems - just modify inittab, no telinit needed during install
|
||||
# Devuan/older systems - modify inittab with flexible runlevel matching
|
||||
if [[ -f /etc/inittab ]]; then
|
||||
sed -i 's|^1:2345:respawn:/sbin/getty.*|1:2345:respawn:/sbin/agetty --autologin root tty1 38400 linux|' /etc/inittab
|
||||
# Match various runlevel patterns (23, 2345, 12345, etc.) and both getty/agetty
|
||||
sed -i 's|^1:[0-9]*:respawn:/sbin/a\?getty.*|1:2345:respawn:/sbin/agetty --autologin root tty1 38400 linux|' /etc/inittab
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -20,22 +20,15 @@ load_functions
|
||||
VERBOSE=${var_verbose:-no}
|
||||
APP="nextcloud-exporter"
|
||||
APP_TYPE="tools"
|
||||
INSTALL_PATH="/opt/nextcloud-exporter"
|
||||
CONFIG_PATH="/opt/nextcloud-exporter.env"
|
||||
header_info
|
||||
ensure_usr_local_bin_persist
|
||||
BINARY_PATH="/usr/bin/nextcloud-exporter"
|
||||
CONFIG_PATH="/etc/nextcloud-exporter.env"
|
||||
SERVICE_PATH="/etc/systemd/system/nextcloud-exporter.service"
|
||||
|
||||
# ==============================================================================
|
||||
# OS DETECTION
|
||||
# ==============================================================================
|
||||
if [[ -f "/etc/alpine-release" ]]; then
|
||||
OS="Alpine"
|
||||
SERVICE_PATH="/etc/init.d/nextcloud-exporter"
|
||||
elif grep -qE 'ID=debian|ID=ubuntu' /etc/os-release; then
|
||||
OS="Debian"
|
||||
SERVICE_PATH="/etc/systemd/system/nextcloud-exporter.service"
|
||||
else
|
||||
echo -e "${CROSS} Unsupported OS detected. Exiting."
|
||||
if ! grep -qE 'ID=debian|ID=ubuntu' /etc/os-release 2>/dev/null; then
|
||||
echo -e "${CROSS} Unsupported OS detected. This script only supports Debian and Ubuntu."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -44,15 +37,14 @@ fi
|
||||
# ==============================================================================
|
||||
function uninstall() {
|
||||
msg_info "Uninstalling Nextcloud-Exporter"
|
||||
if [[ "$OS" == "Alpine" ]]; then
|
||||
rc-service nextcloud-exporter stop &>/dev/null
|
||||
rc-update del nextcloud-exporter &>/dev/null
|
||||
rm -f "$SERVICE_PATH"
|
||||
else
|
||||
systemctl disable -q --now nextcloud-exporter
|
||||
rm -f "$SERVICE_PATH"
|
||||
|
||||
if dpkg -l | grep -q nextcloud-exporter; then
|
||||
$STD apt-get remove -y nextcloud-exporter || $STD dpkg -r nextcloud-exporter
|
||||
fi
|
||||
rm -rf "$INSTALL_PATH" "$CONFIG_PATH"
|
||||
|
||||
rm -f "$CONFIG_PATH"
|
||||
rm -f "/usr/local/bin/update_nextcloud-exporter"
|
||||
rm -f "$HOME/.nextcloud-exporter"
|
||||
msg_ok "Nextcloud-Exporter has been uninstalled"
|
||||
@ -64,22 +56,13 @@ function uninstall() {
|
||||
function update() {
|
||||
if check_for_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter"; then
|
||||
msg_info "Stopping service"
|
||||
if [[ "$OS" == "Alpine" ]]; then
|
||||
rc-service nextcloud-exporter stop &>/dev/null
|
||||
else
|
||||
systemctl stop nextcloud-exporter
|
||||
fi
|
||||
msg_ok "Stopped service"
|
||||
|
||||
fetch_and_deploy_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter" "prebuild" "latest" "nextcloud-exporter_*_amd64.deb"
|
||||
setup_go
|
||||
fetch_and_deploy_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter" "binary" "latest"
|
||||
|
||||
msg_info "Starting service"
|
||||
if [[ "$OS" == "Alpine" ]]; then
|
||||
rc-service nextcloud-exporter start &>/dev/null
|
||||
else
|
||||
systemctl start nextcloud-exporter
|
||||
fi
|
||||
msg_ok "Started service"
|
||||
msg_ok "Updated successfully"
|
||||
exit
|
||||
@ -115,16 +98,15 @@ function install() {
|
||||
NEXTCLOUD_TLS_SKIP_VERIFY="true"
|
||||
fi
|
||||
|
||||
fetch_and_deploy_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter" "prebuild" "latest" "nextcloud-exporter_*_amd64.deb"
|
||||
setup_go
|
||||
fetch_and_deploy_gh_release "nextcloud-exporter" "xperimental/nextcloud-exporter" "binary" "latest"
|
||||
|
||||
msg_info "Creating configuration"
|
||||
cat <<EOF >"$CONFIG_PATH"
|
||||
# https://github.com/xperimental/nextcloud-exporter
|
||||
NEXTCLOUD_SERVER="${NEXTCLOUD_SERVER}"
|
||||
NEXTCLOUD_AUTH_TOKEN="${NEXTCLOUD_AUTH_TOKEN}"
|
||||
NEXTCLOUD_USERNAME="${NEXTCLOUD_USERNAME}"
|
||||
NEXTCLOUD_PASSWORD="${NEXTCLOUD_PASSWORD}"
|
||||
NEXTCLOUD_AUTH_TOKEN="${NEXTCLOUD_AUTH_TOKEN:-}"
|
||||
NEXTCLOUD_USERNAME="${NEXTCLOUD_USERNAME:-}"
|
||||
NEXTCLOUD_PASSWORD="${NEXTCLOUD_PASSWORD:-}"
|
||||
NEXTCLOUD_INFO_UPDATE=${NEXTCLOUD_INFO_UPDATE:-"true"}
|
||||
NEXTCLOUD_INFO_APPS=${NEXTCLOUD_INFO_APPS:-"true"}
|
||||
NEXTCLOUD_TLS_SKIP_VERIFY=${NEXTCLOUD_TLS_SKIP_VERIFY:-"false"}
|
||||
@ -133,7 +115,6 @@ EOF
|
||||
msg_ok "Created configuration"
|
||||
|
||||
msg_info "Creating service"
|
||||
if [[ "$OS" == "Debian" ]]; then
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
[Unit]
|
||||
Description=nextcloud-exporter
|
||||
@ -141,9 +122,8 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
WorkingDirectory=/opt/nextcloud-exporter
|
||||
EnvironmentFile=$CONFIG_PATH
|
||||
ExecStart=/opt/nextcloud-exporter/nextcloud-exporter
|
||||
ExecStart=$BINARY_PATH
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
@ -151,34 +131,6 @@ WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now nextcloud-exporter
|
||||
else
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="nextcloud-exporter"
|
||||
description="Nextcloud Exporter for Prometheus"
|
||||
command="${INSTALL_PATH}/nextcloud-exporter"
|
||||
command_background=true
|
||||
directory="/opt/nextcloud-exporter"
|
||||
pidfile="/run/\${RC_SVCNAME}.pid"
|
||||
output_log="/var/log/nextcloud-exporter.log"
|
||||
error_log="/var/log/nextcloud-exporter.log"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
after firewall
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ -f "$CONFIG_PATH" ]; then
|
||||
export \$(grep -v '^#' $CONFIG_PATH | xargs)
|
||||
fi
|
||||
}
|
||||
EOF
|
||||
chmod +x "$SERVICE_PATH"
|
||||
$STD rc-update add nextcloud-exporter default
|
||||
$STD rc-service nextcloud-exporter start
|
||||
fi
|
||||
msg_ok "Created and started service"
|
||||
|
||||
# Create update script
|
||||
@ -194,7 +146,7 @@ UPDATEEOF
|
||||
|
||||
echo ""
|
||||
msg_ok "Nextcloud-Exporter installed successfully"
|
||||
msg_ok "Metrics: ${BL}http://${CURRENT_IP}:9205/metrics${CL}"
|
||||
msg_ok "Metrics: ${BL}http://${LOCAL_IP}:9205/metrics${CL}"
|
||||
msg_ok "Config: ${BL}${CONFIG_PATH}${CL}"
|
||||
}
|
||||
|
||||
@ -203,10 +155,11 @@ UPDATEEOF
|
||||
# ==============================================================================
|
||||
header_info
|
||||
ensure_usr_local_bin_persist
|
||||
import_local_ip
|
||||
|
||||
# Handle type=update (called from update script)
|
||||
if [[ "${type:-}" == "update" ]]; then
|
||||
if [[ -d "$INSTALL_PATH" && -f "$INSTALL_PATH/nextcloud-exporter" ]]; then
|
||||
if [[ -f "$BINARY_PATH" ]]; then
|
||||
update
|
||||
else
|
||||
msg_error "Nextcloud-Exporter is not installed. Nothing to update."
|
||||
@ -216,7 +169,7 @@ if [[ "${type:-}" == "update" ]]; then
|
||||
fi
|
||||
|
||||
# Check if already installed
|
||||
if [[ -d "$INSTALL_PATH" && -f "$INSTALL_PATH/nextcloud-exporter" ]]; then
|
||||
if [[ -f "$BINARY_PATH" ]]; then
|
||||
msg_warn "Nextcloud-Exporter is already installed."
|
||||
echo ""
|
||||
|
||||
@ -243,7 +196,7 @@ msg_warn "Nextcloud-Exporter is not installed."
|
||||
echo ""
|
||||
echo -e "${TAB}${INFO} This will install:"
|
||||
echo -e "${TAB} - Nextcloud Exporter (Go binary)"
|
||||
echo -e "${TAB} - Systemd/OpenRC service"
|
||||
echo -e "${TAB} - Systemd service"
|
||||
echo ""
|
||||
|
||||
echo -n "${TAB}Install Nextcloud-Exporter? (y/N): "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user