Skip to content

Instantly share code, notes, and snippets.

@michaelgreenhill
Created June 19, 2020 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelgreenhill/ce70ba16a8bfabcdc1b412576c85b43a to your computer and use it in GitHub Desktop.
Save michaelgreenhill/ce70ba16a8bfabcdc1b412576c85b43a to your computer and use it in GitHub Desktop.
Stop qnap from taking over port 80
#!/bin/bash
# This script replaces the config directive to run Qthttpd on port 80 with port 81
# It then starts the Lancache container
# The entire block is wrapped in an if statement to check if it's already running...
if [[ $(docker container ls | grep lancache01$ | wc -l) == 0 ]]; then
/bin/sed -i -re 's#(\s+)("/usr/local/sbin/Qthttpd -p) (80) (.*)#\1\2 81 \4#' /etc/init.d/Qthttpd.sh
/etc/init.d/Qthttpd.sh restart
docker container start selby-lancache01
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment