Port Scrutiny to arm64

This commit is contained in:
Sam Heinz
2024-06-26 22:03:09 +10:00
parent c31c9b7209
commit cdc71caab6
2 changed files with 15 additions and 13 deletions
+9 -9
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) source <(curl -s https://raw.githubusercontent.com/asylumexp/Proxmox/main/misc/build.func)
# Copyright (c) 2021-2024 tteck # Copyright (c) 2021-2024 tteck
# Author: tteck # Author: tteck
# Co-Author: MickLesk (Canbiz) # Co-Author: MickLesk (Canbiz)
@@ -79,12 +79,12 @@ function update_script() {
rm -rf scrutiny_bak rm -rf scrutiny_bak
mv scrutiny scrutiny_bak mv scrutiny scrutiny_bak
mkdir -p /opt/scrutiny/web /opt/scrutiny/bin mkdir -p /opt/scrutiny/web /opt/scrutiny/bin
wget -q -O /opt/scrutiny/bin/scrutiny-web-linux-amd64 "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-web-linux-amd64" wget -q -O /opt/scrutiny/bin/scrutiny-web-linux-arm64 "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-web-linux-arm64"
wget -q -O /opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-collector-metrics-linux-amd64" wget -q -O /opt/scrutiny/bin/scrutiny-collector-metrics-linux-arm64 "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-collector-metrics-linux-arm64"
wget -q -O /opt/scrutiny/web/scrutiny-web-frontend.tar.gz "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-web-frontend.tar.gz" wget -q -O /opt/scrutiny/web/scrutiny-web-frontend.tar.gz "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-web-frontend.tar.gz"
cd /opt/scrutiny/web && tar xvzf scrutiny-web-frontend.tar.gz --strip-components 1 -C . cd /opt/scrutiny/web && tar xvzf scrutiny-web-frontend.tar.gz --strip-components 1 -C .
chmod +x /opt/scrutiny/bin/scrutiny-web-linux-amd64 chmod +x /opt/scrutiny/bin/scrutiny-web-linux-arm64
chmod +x /opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 chmod +x /opt/scrutiny/bin/scrutiny-collector-metrics-linux-arm64
echo "${RELEASE}" > /opt/scrutiny_version.txt echo "${RELEASE}" > /opt/scrutiny_version.txt
msg_ok "Updated Scrutiny to $RELEASE" msg_ok "Updated Scrutiny to $RELEASE"
@@ -125,7 +125,7 @@ After=network.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/opt/scrutiny/bin/scrutiny-web-linux-amd64 start --config /opt/scrutiny/config/scrutiny.yaml ExecStart=/opt/scrutiny/bin/scrutiny-web-linux-arm64 start --config /opt/scrutiny/config/scrutiny.yaml
Restart=always Restart=always
User=root User=root
@@ -150,8 +150,8 @@ if [ "$UPD" == "3" ]; then
msg_ok "Stopped Scrutiny Collector Service" msg_ok "Stopped Scrutiny Collector Service"
else else
msg_info "Scrutiny Collector Service not found, creating..." msg_info "Scrutiny Collector Service not found, creating..."
wget -q -O /opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-collector-metrics-linux-amd64" wget -q -O /opt/scrutiny/bin/scrutiny-collector-metrics-linux-arm64 "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-collector-metrics-linux-arm64"
chmod +x /opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 chmod +x /opt/scrutiny/bin/scrutiny-collector-metrics-linux-arm64
cat <<EOF >/etc/systemd/system/scrutiny_collector.service cat <<EOF >/etc/systemd/system/scrutiny_collector.service
[Unit] [Unit]
Description=Scrutiny Collector Description=Scrutiny Collector
@@ -159,7 +159,7 @@ After=network.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 run --api-endpoint "http://localhost:8080" ExecStart=/opt/scrutiny/bin/scrutiny-collector-metrics-linux-arm64 run --api-endpoint "http://localhost:8080"
Restart=always Restart=always
User=root User=root
+6 -4
View File
@@ -21,7 +21,9 @@ $STD apt-get install -y \
curl \ curl \
smartmontools \ smartmontools \
make \ make \
mc mc \
wget \
openssh-server
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing Scrutiny WebApp" msg_info "Installing Scrutiny WebApp"
@@ -29,11 +31,11 @@ mkdir -p /opt/scrutiny/{config,web,bin}
RELEASE=$(curl -s https://api.github.com/repos/analogj/scrutiny/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') RELEASE=$(curl -s https://api.github.com/repos/analogj/scrutiny/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
echo "${RELEASE}" >/opt/${APP}_version.txt echo "${RELEASE}" >/opt/${APP}_version.txt
wget -q -O /opt/scrutiny/config/scrutiny.yaml https://raw.githubusercontent.com/AnalogJ/scrutiny/master/example.scrutiny.yaml wget -q -O /opt/scrutiny/config/scrutiny.yaml https://raw.githubusercontent.com/AnalogJ/scrutiny/master/example.scrutiny.yaml
wget -q -O /opt/scrutiny/bin/scrutiny-web-linux-amd64 "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-web-linux-amd64" wget -q -O /opt/scrutiny/bin/scrutiny-web-linux-arm64 "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-web-linux-arm64"
wget -q -O /opt/scrutiny/web/scrutiny-web-frontend.tar.gz "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-web-frontend.tar.gz" wget -q -O /opt/scrutiny/web/scrutiny-web-frontend.tar.gz "https://github.com/AnalogJ/scrutiny/releases/download/${RELEASE}/scrutiny-web-frontend.tar.gz"
cd /opt/scrutiny/web cd /opt/scrutiny/web
tar xzf scrutiny-web-frontend.tar.gz --strip-components 1 -C . tar xzf scrutiny-web-frontend.tar.gz --strip-components 1 -C .
chmod +x /opt/scrutiny/bin/scrutiny-web-linux-amd64 chmod +x /opt/scrutiny/bin/scrutiny-web-linux-arm64
msg_ok "Installed Scrutiny WebApp" msg_ok "Installed Scrutiny WebApp"
msg_info "Setup Service" msg_info "Setup Service"
@@ -44,7 +46,7 @@ After=network.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/opt/scrutiny/bin/scrutiny-web-linux-amd64 start --config /opt/scrutiny/config/scrutiny.yaml ExecStart=/opt/scrutiny/bin/scrutiny-web-linux-arm64 start --config /opt/scrutiny/config/scrutiny.yaml
Restart=always Restart=always
User=root User=root