mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-06-22 23:41:18 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b45fc21ef |
+14
-3
@@ -29,10 +29,21 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
setup_mariadb
|
||||
ensure_dependencies git
|
||||
if [[ ! -d /opt/librenms/.git ]]; then
|
||||
msg_info "Initializing LibreNMS git metadata"
|
||||
LIBRENMS_VERSION=$(cat ~/.librenms 2>/dev/null)
|
||||
cd /opt/librenms
|
||||
git init -q
|
||||
git remote add origin https://github.com/librenms/librenms.git
|
||||
git fetch --depth 1 origin "refs/tags/v${LIBRENMS_VERSION}" 2>/dev/null ||
|
||||
git fetch --depth 1 origin "refs/tags/${LIBRENMS_VERSION}" 2>/dev/null || true
|
||||
git checkout -qf FETCH_HEAD 2>/dev/null || true
|
||||
chown -R librenms:librenms .git
|
||||
msg_ok "Initialized LibreNMS git metadata"
|
||||
fi
|
||||
msg_info "Updating LibreNMS"
|
||||
su librenms
|
||||
cd /opt/librenms
|
||||
./daily.sh
|
||||
$STD su - librenms -s /bin/bash -c 'cd /opt/librenms && ./daily.sh'
|
||||
msg_ok "Updated LibreNMS"
|
||||
exit
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
acl \
|
||||
fping \
|
||||
git \
|
||||
graphviz \
|
||||
imagemagick \
|
||||
mtr-tiny \
|
||||
@@ -64,6 +65,16 @@ EOF
|
||||
chown -R librenms:librenms /opt/librenms
|
||||
chmod 771 /opt/librenms
|
||||
chmod -R ug=rwX /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/logs /opt/librenms/rrd
|
||||
if [[ ! -d /opt/librenms/.git ]]; then
|
||||
LIBRENMS_VERSION=$(cat ~/.librenms 2>/dev/null)
|
||||
cd /opt/librenms
|
||||
git init -q
|
||||
git remote add origin https://github.com/librenms/librenms.git
|
||||
git fetch --depth 1 origin "refs/tags/v${LIBRENMS_VERSION}" 2>/dev/null ||
|
||||
git fetch --depth 1 origin "refs/tags/${LIBRENMS_VERSION}" 2>/dev/null || true
|
||||
git checkout -qf FETCH_HEAD 2>/dev/null || true
|
||||
chown -R librenms:librenms .git
|
||||
fi
|
||||
msg_ok "Configured LibreNMS"
|
||||
|
||||
msg_info "Configure MariaDB"
|
||||
|
||||
+4
-17
@@ -8452,34 +8452,29 @@ setup_ruby() {
|
||||
fi
|
||||
|
||||
# Install ruby-build plugin
|
||||
_install_ruby_build_plugin() {
|
||||
if [[ ! -d "$RBENV_DIR/plugins/ruby-build" ]]; then
|
||||
local RUBY_BUILD_RELEASE
|
||||
RUBY_BUILD_RELEASE=$(get_latest_github_release "rbenv/ruby-build") || {
|
||||
msg_error "Failed to fetch latest ruby-build version from GitHub"
|
||||
rm -rf "$TMP_DIR"
|
||||
return 7
|
||||
}
|
||||
|
||||
if ! curl_with_retry "https://github.com/rbenv/ruby-build/archive/refs/tags/v${RUBY_BUILD_RELEASE}.tar.gz" "$TMP_DIR/ruby-build.tar.gz"; then
|
||||
msg_error "Failed to download ruby-build"
|
||||
msg_error "Hint: Check connectivity to github.com/rbenv/ruby-build"
|
||||
rm -rf "$TMP_DIR"
|
||||
return 7
|
||||
fi
|
||||
|
||||
tar -xzf "$TMP_DIR/ruby-build.tar.gz" -C "$TMP_DIR" || {
|
||||
msg_error "Failed to extract ruby-build"
|
||||
rm -rf "$TMP_DIR"
|
||||
return 251
|
||||
}
|
||||
|
||||
mkdir -p "$RBENV_DIR/plugins/ruby-build"
|
||||
cp -r "$TMP_DIR/ruby-build-${RUBY_BUILD_RELEASE}/." "$RBENV_DIR/plugins/ruby-build/"
|
||||
return 0
|
||||
}
|
||||
|
||||
if [[ ! -d "$RBENV_DIR/plugins/ruby-build" ]]; then
|
||||
_install_ruby_build_plugin || {
|
||||
rm -rf "$TMP_DIR"
|
||||
return 7
|
||||
}
|
||||
fi
|
||||
|
||||
# Setup PATH and install Ruby version
|
||||
@@ -8487,14 +8482,6 @@ setup_ruby() {
|
||||
eval "$("$RBENV_BIN" init - bash)" 2>/dev/null || true
|
||||
|
||||
if ! "$RBENV_BIN" versions --bare 2>/dev/null | grep -qx "$RUBY_VERSION"; then
|
||||
if [[ ! -f "$RBENV_DIR/plugins/ruby-build/share/ruby-build/$RUBY_VERSION" ]]; then
|
||||
msg_info "Updating ruby-build definitions"
|
||||
_install_ruby_build_plugin || {
|
||||
rm -rf "$TMP_DIR"
|
||||
return 7
|
||||
}
|
||||
msg_ok "Updated ruby-build definitions"
|
||||
fi
|
||||
$STD "$RBENV_BIN" install "$RUBY_VERSION" || {
|
||||
msg_error "Failed to install Ruby $RUBY_VERSION"
|
||||
rm -rf "$TMP_DIR"
|
||||
|
||||
Reference in New Issue
Block a user