This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nezha-olp-exporter/src/main/resources/build/install.sh

27 lines
579 B
Bash
Raw Normal View History

#!/bin/bash
CUR_PATH=`pwd`
echo "install path: $CUR_PATH"
echo "install olp_exporter as a systemd service"
chmod +x $CUR_PATH/olp_exporter
cat > /etc/systemd/system/olp_exporter.service <<EOF
[Unit]
Description=olp_exporter
After=syslog.target
[Service]
ExecStart=$CUR_PATH/olp_exporter
SuccessExitStatus=143
RestartSec=10s
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
echo "systemctl start olp_exporter.service"
systemctl start olp_exporter.service
echo "Set the power-on start-up"
systemctl enable olp_exporter.service
echo "install done"