Run custom scripts on Unifi OS Startup.
-
Run:
⚠️ Please review the installer source code before running it on your system.⚠️ wget -O - https://raw.githubusercontent.com/fdcastel/unifi-dawn/master/install.sh | bash
-
Put your scripts in
/data/unifi-dawn.d/
directory.- Each script MUST start with a shebang or the initialization will fail.
- Also, remember to
chmod +x
them. Non-executable files will be ignored.
On Unifi OS startup, as soon as the network becomes available, the scripts from /data/unifi-dawn.d/
will be executed in alphabetical order.
-
To check the service status:
systemctl status unifi-dawn
-
To see the scripts output (logs):
journalctl -u unifi-dawn
SCRIPT_FILE=/data/unifi-dawn.d/10-test-download.sh
cat > $SCRIPT_FILE <<EOF
#!/bin/bash
wget -4 -O /tmp/temp.sh https://raw.githubusercontent.com/fdcastel/unifi-dawn/master/install.sh
EOF
chmod +x $SCRIPT_FILE
# Remove service link (uninstall service)
systemctl disable unifi-dawn.service
# Remove script file
rm /etc/systemd/system/unifi-dawn.service