Last active
July 4, 2025 15:10
-
-
Save sboger/54d9d7cc7e0c011f708912d603d57fc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #cloud-config | |
| package_update: true | |
| package_upgrade: true | |
| packages: | |
| - openjdk-17-jre-headless | |
| - jsvc | |
| - avahi-daemon | |
| runcmd: | |
| - curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor | |
| - echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/8.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-8.0.list | |
| - apt-get update | |
| - apt-get install -y mongodb-org | |
| - systemctl enable mongod | |
| - curl -fsSL -o /home/ubuntu/update-omada.sh https://gist.githubusercontent.com/sboger/54d9d7cc7e0c011f708912d603d57fc7/raw/980e035e0e69da1b4c6a6a2f313b8f3f57a2ac85/update-omada.sh | |
| - chmod +x /home/ubuntu/update-omada.sh | |
| - cd /home/ubuntu; ./update-omada.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ "$(id -u)" -ne 0 ]; then | |
| exec sudo "$0" "$@" | |
| fi | |
| OMADA_URL=$(curl -fsSL "https://support.omadanetworks.com/en/download/software/omada-controller/" | grep -o 'https://static\.tp-link\.com/upload/software/[^"]*linux_x64[^"]*\.deb' | head -n1) | |
| OMADA_PKG=$(basename "$OMADA_URL") | |
| if [ -z "$OMADA_PKG" ]; then | |
| echo "Could not get list of omada debs – server may be down." | |
| exit 1 | |
| fi | |
| if [ ! -f "$OMADA_PKG" ]; then | |
| echo "Downloading $OMADA_PKG" | |
| curl -fsSL "$OMADA_URL" -o "$OMADA_PKG" | |
| fi | |
| if [ ! -f "$OMADA_PKG" ]; then | |
| echo "Unable to download $OMADA_PKG - server may be down." | |
| exit 1 | |
| fi | |
| apt-get upgrade -y "./$OMADA_PKG" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment