4360psufix.sh/rr4360psu_install.sh
2017-09-10 19:40:34 -07:00

22 lines
No EOL
993 B
Bash

#!/bin/bash
get_service="http://ntgr.support/scripts/readynas_os_6/rr4360psu.service"
get_script="http://ntgr.support/scripts/readynas_os_6/rr4360psu.sh"
get_timer="http://ntgr.support/scripts/readynas_os_6/rr4360psu.timer"
script="/etc/frontview/support/rr4360psu.sh"
echo "This is the installer for the RR4360 PSU reporting Offline issue."
echo "It installs files in their appropriate locations and then schedules a run at the top of every hour."
echo "Installing systemd components. "
wget -q "$get_script" -O "$script"
chmod +x "$script"
wget -q "$get_service" -O "/etc/systemd/system/rr4360psu.service"
wget -q "$get_timer" -O "/etc/systemd/system/rr4360psu.timer"
echo "Enabling the systemd timer."
systemctl daemon-reload
systemctl enable rr4360psu.timer
systemctl start rr4360psu.timer
echo "Done"
echo "Since this is freshly installed, running for the first time, then removing the installer."
$script
rm "$0"
echo "Removed the installer and exiting the installation procedure. Cya!"