2020-05-31 13:40:04 +00:00
# UDM / UDMPro Boot Script
2020-07-13 05:37:04 +00:00
## Features
2020-05-31 13:40:04 +00:00
1. Allows you to run a shell script at S95 anytime your UDM starts / reboots
2020-07-06 03:09:26 +00:00
1. Persists through reboot and **firmware updates** ! It is able to do this because Ubiquiti caches all debian package installs on the UDM in /mnt/data, then re-installs them on every boot
2020-07-13 05:37:04 +00:00
## Compatibility
2020-05-31 13:40:04 +00:00
2020-05-31 15:52:00 +00:00
1. Should work on any UDM/UDMPro after 1.6.3
2020-06-28 13:02:50 +00:00
2. Tested and confirmed on 1.6.6, 1.7.0, 1.7.2rc4, 1.7.3rc1
2020-05-31 16:35:32 +00:00
2020-07-06 03:09:26 +00:00
### Upgrade from earlier way
2020-07-13 05:37:04 +00:00
2020-07-06 03:09:26 +00:00
* 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....
2020-07-13 05:37:04 +00:00
```bash
rm /etc/init.d/udm.sh
systemctl disable udmboot
rm /etc/systemd/system/udmboot.service
```
2020-07-06 03:09:26 +00:00
* The new package is exactly the old steps packaged in a debian package
* [dpkg-build-files ](dpkg-build-files ) contains the scripts that build the package (using dh_make and debuild) if you want to build it yourself / change it
* Built on Ubuntu-20.04 on Windows 10/WSL2
2020-06-05 03:50:23 +00:00
2020-07-06 03:09:26 +00:00
## Steps
2020-07-13 05:37:04 +00:00
2020-07-07 07:50:05 +00:00
1. Get into the unifios shell on your udm
2020-07-13 05:37:04 +00:00
```bash
unifi-os shell
```
2020-07-07 07:50:32 +00:00
2. Download [udm-boot_1.0.1-1_all.deb ](packages/udm-boot_1.0.1-1_all.deb ) and install it and go back to the UDM
2020-07-13 05:37:04 +00:00
```bash
curl -L https://raw.githubusercontent.com/boostchicken/udm-utilities/master/on-boot-script/packages/udm-boot_1.0.1-1_all.deb -o udm-boot_1.0.1-1_all.deb
dpkg -i udm-boot_1.0.1-1_all.deb
exit
```
2020-07-07 07:50:05 +00:00
3. Copy any shell scripts you want to run to /mnt/data/on_boot.d on your UDM (not the unifi-os shell)and make sure they are executable and have the correct shebang (#!/bin/sh)
2020-07-13 05:37:04 +00:00
Examples:
2020-06-28 13:02:50 +00:00
* Start a DNS Container [10-dns.sh ](../dns-common/on_boot.d/10-dns.sh )
2020-07-06 05:39:21 +00:00
* Start wpa_supplicant [on_boot.d/10-wpa_supplicant.sh ](examples/udm-files/on_boot.d/10-wpa_supplicant.sh )
2020-07-07 07:52:02 +00:00
## Version History
### 1.0.1
2020-07-13 05:37:04 +00:00
2020-07-07 07:52:02 +00:00
* Fully automated install, all that is left is populating /mnt/data/on_boot.d
### 1.0.0
2020-07-13 05:37:04 +00:00
2020-07-13 05:38:01 +00:00
* First release that persists through firmware