#!/usr/bin/env bash set -Eeuo pipefail . /run/helpers.sh [ ! -f "/run/init_container.sh" ] && error "Script must run inside Docker container!" && exit 11 [ "$(id -u)" -ne "0" ] && error "Script must be executed with root privileges." && exit 12 APP="OpenWrt" SUPPORT="https://github.com/AlbrechtL/openwrt-docker-arm64-build" echo "❯ Starting $APP for Docker v$( /var/www/system_info.txt cat /var/vm/openwrt_metadata.conf >> /var/www/system_info.txt echo $'\n' >> /var/www/system_info.txt echo "* Enviroment variables *" >> /var/www/system_info.txt export >> /var/www/system_info.txt echo $'\n' >> /var/www/system_info.txt echo "* USB devices *" >> /var/www/system_info.txt lsusb >> /var/www/system_info.txt sed -i 's/---SED_REPLACEMENT_TAG---/"system_info.txt"/g' /var/www/index.html fi # ******* script-server handling ******* # Ugly hack to enable iframe usage sed -i "s/'X-Frame-Options', 'DENY'/ \ 'X-Frame-Options', 'ALLOWALL'/g" \ /usr/share/script-server/src/web/server.py # Usage of default logging.json' cp -f /usr/share/script-server/conf/logging.json /var/script-server/logging.json # Start script-server supervisorctl start script-server # ******* nginx handling ******* cp -r /var/www/* /run/shm supervisorctl start nginx # Start webserver # ******* OpenWrt handling ******* supervisorctl start openwrt # Start openwrt # ******* LuCi forwarding handling ******* if [[ $FORWARD_LUCI = "true" ]]; then if [[ $LAN_IF = "veth" ]]; then info "Enable LuCI forwading to host LAN at port 9000" supervisorctl start caddy # Start reverse proxy else error "LuCI forwading is only available if enviroment variable is set to LAN_IF: 'veth'" fi fi