unifios-utilities/on-boot-script
John Dorman df2a0f9144
moved to bash (#499)
thanks @kb9gxk
2023-02-22 21:44:27 -08:00
..
dpkg-build-files Auto set correct data path (#491) 2023-02-22 08:49:54 -08:00
examples moved to bash (#499) 2023-02-22 21:44:27 -08:00
manual-install moved to bash (#499) 2023-02-22 21:44:27 -08:00
packages 1.0.7 2023-01-31 22:22:14 -08:00
build_deb.sh moved to bash (#499) 2023-02-22 21:44:27 -08:00
Dockerfile Some build and package improvements (#45) 2020-09-08 02:54:51 -07:00
README.md moved to bash (#499) 2023-02-22 21:44:27 -08:00
README.old.md moved to bash (#499) 2023-02-22 21:44:27 -08:00
remote_install.sh Auto set correct data path (#491) 2023-02-22 08:49:54 -08:00

UDM / UDMPro Boot Script

Features

  1. Allows you to run a shell script at S95 anytime your UDM starts / reboots
  2. Persists through reboot and firmware updates! It is able to do this because Ubiquiti caches all debian package installs on the UDM in /data, then re-installs them on reset of unifi-os container.

Compatibility

  1. Should work on any UDM/UDMPro after 1.6.3
  2. Tested and confirmed on 1.6.6, 1.7.0, 1.7.2rc4, 1.7.3rc1, 1.8.0rc7, 1.8.0+

Upgrade from earlier way

  • As long as you didn't change the filenames, installing the deb package is all you need to do. If you want to clean up beforehand anyways....

    rm /etc/init.d/udm.sh
    systemctl disable udmboot
    rm /etc/systemd/system/udmboot.service
    
  • build_deb.sh can be used to build the package by yourself.

    • dpkg-build-files contains the sources that debuild uses to build the package if you want to build it yourself / change it
    • by default it uses docker or podman to build the debian package
    • use ./build_deb.sh build to not use a container
    • the resulting package will be in packages/
  • Built on Ubuntu-20.04 on Windows 10/WSL2

Install

You can execute in UDM/Pro/SE and UDR with:

curl -fsL "https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/HEAD/on-boot-script/remote_install.sh" | /bin/sh

This is a force to install script so will uninstall any previous version and install on_boot keeping your on boot files.

This will also install CNI Plugins & CNI Bridge scripts. If you are using UDMSE/UDR remember that you must install podman manually because there is no podman.

Manually Install Steps

  1. Get into the unifios shell on your udm

    unifi-os shell
    
  2. Download udm-boot_1.0.7_all.deb and install it and go back to the UDM. The latest package will always be found at https://udm-boot.boostchicken.dev

    curl -L https://unifi.boostchicken.io/udm-boot_1.0.7_all.deb -o udm-boot_1.0.7_all.deb
    dpkg -i udm-boot_1.0.7_all.deb
    systemctl enable udm-boot
    exit
    
  3. Copy any shell scripts you want to run to /data/on_boot.d on your UDM (not the unifi-os shell) and make sure they are executable and have the correct shebang (#!/bin/bash). Additionally, scripts need to have a .sh extention in their filename.

    Examples:

Version History

1.0.7

  • Support for Legacy and Current Firmware

1.0.6

  • Fix timeouts

1.0.5

  • Remove on_boot.sh from UDM
  • Follow symlinks
  • move to network-online.target

1.0.4

  • Fix 600s timeout issues
  • Fix rc.d policy issue

1.0.3

  • Fix not working after firmware upgrade
  • Added udm-boot.boostchicken.dev domain

1.0.2

  • Some build improvements and more clean installation

1.0.1

  • Fully automated install, all that is left is populating /data/on_boot.d

1.0.0

  • First release that persists through firmware