unifios-utilities/on-boot-script-2.x/README.md

62 lines
2.2 KiB
Markdown
Raw Normal View History

2023-02-19 03:31:32 +00:00
# UDM / UDMPro Boot Script
## Features
1. Allows you to run a shell script at S95 anytime your UDM starts / reboots
## Compatibility
1. Should work on any UDM/UDMPro after 2.4.x
- [build_deb.sh](build_deb.sh) can be used to build the package by yourself.
2023-02-19 03:31:32 +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/)
2023-02-19 03:31:32 +00:00
- Built on Ubuntu-20.04 on Windows 10/WSL2
2023-02-19 03:31:32 +00:00
## Install
You can execute in UDM/Pro/SE and UDR with:
```bash
curl -fsL "https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/HEAD/on-boot-script-2.x/remote_install.sh" | /bin/sh
2023-02-19 03:31:32 +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
1. Get into the unifios shell on your udm
```bash
unifi-os shell
```
2023-02-19 03:31:32 +00:00
2. Download [udm-boot-2x_1.0.1_all.deb](packages/udm-boot_1.0.0-2x_all.deb) and install it and go back to the UDM.
```bash
curl -L [[https://udm-boot.boostchicken.dev](https://unifi.boostchicken.io/udm-boot-2x_1.0.0_all.deb)](https://unifi.boostchicken.io/udm-boot-2x_1.0.0_all.deb) -o udm-boot-2x_1.0.0_all.deb
dpkg -i udm-boot-2x_1.0.0_all.deb
systemctl enable udm-boot
exit
```
2023-02-19 03:31:32 +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.
2023-02-19 03:31:32 +00:00
Examples:
- 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)
2023-02-19 03:31:32 +00:00
## Version History
### 1.0.0
- First release that persists through firmware