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
2023-02-22 16:49:54 +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 /data, then re-installs them on reset of unifi-os container.
2020-07-06 03:09:26 +00:00
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
2021-01-30 00:31:28 +00:00
2. Tested and confirmed on 1.6.6, 1.7.0, 1.7.2rc4, 1.7.3rc1, 1.8.0rc7, 1.8.0+
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
2023-02-22 16:49:54 +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
2023-02-22 16:49:54 +00:00
```bash
rm /etc/init.d/udm.sh
systemctl disable udmboot
rm /etc/systemd/system/udmboot.service
```
2020-07-13 05:37:04 +00:00
2023-02-22 16:49:54 +00:00
- [build_deb.sh ](build_deb.sh ) can be used to build the package by yourself.
2020-09-08 09:54:51 +00:00
2023-02-22 16:49:54 +00:00
- [dpkg-build-files ](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/ ](packages/ )
- Built on Ubuntu-20.04 on Windows 10/WSL2
2020-06-05 03:50:23 +00:00
2022-01-16 12:21:20 +00:00
## Install
You can execute in UDM/Pro/SE and UDR with:
```bash
2022-06-24 15:16:09 +00:00
curl -fsL "https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/HEAD/on-boot-script/remote_install.sh" | /bin/sh
2022-01-16 12:21:20 +00:00
```
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
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
2023-02-22 16:49:54 +00:00
```bash
unifi-os shell
```
2. Download [udm-boot_1.0.7_all.deb ](packages/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
2020-07-13 05:37:04 +00:00
2023-02-22 16:49:54 +00:00
```bash
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
```
2020-07-13 05:37:04 +00:00
2023-02-23 05:44:27 +00:00
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.
2020-07-13 05:37:04 +00:00
2023-02-22 16:49:54 +00:00
Examples:
2020-07-13 05:37:04 +00:00
2023-02-22 16:49:54 +00:00
- Start a DNS Container [10-dns.sh ](../dns-common/on_boot.d/10-dns.sh )
- Start wpa_supplicant [on_boot.d/10-wpa_supplicant.sh ](examples/udm-files/on_boot.d/10-wpa_supplicant.sh )
- Add a persistent ssh key for the root user [on_boot.d/15-add-root-ssh-keys.sh ](examples/udm-files/on_boot.d/15-add-root-ssh-keys.sh )
2020-07-07 07:52:02 +00:00
## Version History
2023-02-11 10:24:57 +00:00
### 1.0.7
2023-02-22 16:49:54 +00:00
- Support for Legacy and Current Firmware
2023-02-11 10:24:57 +00:00
### 1.0.6
2023-02-22 16:49:54 +00:00
- Fix timeouts
2023-02-11 10:24:57 +00:00
2021-05-25 17:40:39 +00:00
### 1.0.5
2023-02-22 16:49:54 +00:00
- Remove on_boot.sh from UDM
- Follow symlinks
- move to network-online.target
2021-05-25 17:40:39 +00:00
2021-01-30 01:17:19 +00:00
### 1.0.4
2023-02-22 16:49:54 +00:00
- Fix 600s timeout issues
- Fix rc.d policy issue
2021-01-30 01:17:19 +00:00
2021-01-30 00:31:28 +00:00
### 1.0.3
2023-02-22 16:49:54 +00:00
- Fix not working after firmware upgrade
- Added udm-boot.boostchicken.dev domain
2021-01-30 00:31:28 +00:00
2020-09-08 09:54:51 +00:00
### 1.0.2
2023-02-22 16:49:54 +00:00
- Some build improvements and more clean installation
2020-09-08 09:54:51 +00:00
2020-07-07 07:52:02 +00:00
### 1.0.1
2020-07-13 05:37:04 +00:00
2023-02-22 16:49:54 +00:00
- Fully automated install, all that is left is populating /data/on_boot.d
2020-07-07 07:52:02 +00:00
### 1.0.0
2020-07-13 05:37:04 +00:00
2023-02-22 16:49:54 +00:00
- First release that persists through firmware