Skip to content

Instantly share code, notes, and snippets.

@mbierman
Created January 21, 2022 21:00
Show Gist options
  • Save mbierman/80a93861295ed07bb8def0b7f9394f38 to your computer and use it in GitHub Desktop.
Save mbierman/80a93861295ed07bb8def0b7f9394f38 to your computer and use it in GitHub Desktop.
Homebridge startup scripts for my Synology and Firewalla to install necessary packages
#!/bin/sh
#
# Docker Homebridge Custom Startup Script - oznu/homebridge
#
# This script can be used to customise the environment and will be executed as
# the root user each time the container starts.
#
# If using this to install plugins DO NOT use the global flag (-g).
#
# Example installing homebridge plugin:
#
# npm install homebridge-hue
#
# Example installing packages using default image (Alpine Linux):
#
# apk add --no-cache ffmpeg ffmpeg-libs libpcap-dev
#
# If you're running a debian based version of this container please use apt-get to install packages.
echo $(date) homebridge started >> /homebridge/update.log
if [[ -z '$(crontab -l | grep -e "reboot.sh")' ]] ; then
echo "2 1 * * * /homebridge/reboot.sh -u -r" | tee -a /etc/crontabs/root
fi
if ! [[ -x "$(command -v jq)" ]] ; then
apk update
apk add jq
rm -rf /var/cache/apk/*
else
echo "jq is already installed."
fi
#!/bin/sh
#
# Docker Homebridge Custom Startup Script - oznu/homebridge
#
# This script can be used to customise the environment and will be executed as
# the root user each time the container starts.
#
# If using this to install plugins DO NOT use the global flag (-g).
#
# Example installing homebridge plugin:
#
# npm install homebridge-hue
#
# Example installing packages using default image (Alpine Linux):
#
# apk add --no-cache ffmpeg ffmpeg-libs libpcap-dev
#
# If you're running a debian based version of this container please use apt-get to install packages.
echo $(date) homebridge started >> /homebridge/update.log
if ! [[ -x "$(command -v apk)" ]]; then
apk update
apk add --no-cache ffmpeg ffmpeg-libs libpcap-dev
rm -rf /var/cache/apk/*
else
echo "ffmpeg is already installed."
fi
if ! [[ -x "$(command -v jq)" ]] ; then
apk update
apk add jq
rm -rf /var/cache/apk/*
else
echo "jq is already installed."
fi
if [[ -z '$(crontab -l | grep -e "reboot.sh")' ]] ; then
echo "2 1 * * * /homebridge/reboot.sh -u -r" | tee -a /etc/crontabs/root
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment