Files
openwrt-docker/src/helpers.sh
T

19 lines
838 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -Eeuo pipefail
info () { printf "%b%s%b" "\E[1;34m❯ \E[1;36m" "$1" "\E[0m\n"; }
error () { printf "%b%s%b" "\E[1;31m❯ " "ERROR: $1" "\E[0m\n" >&2; }
warn () { printf "%b%s%b" "\E[1;31m❯ " "Warning: $1" "\E[0m\n"; }
trap 'error "Status $? while: $BASH_COMMAND (line $LINENO/$BASH_LINENO)"' ERR
# Docker environment variables
: "${CPU_COUNT:=""}" # Physical LAN interface name
: "${WAN_IF:=""}" # Physical WAN interface name
: "${LAN_IF:=""}" # Physical LAN interface name
: "${USB_1:=""}" # USB 1 vendor and device ID
: "${USB_2:=""}" # USB 2 vendor and device ID
: "${FORWARD_LUCI:=""}" # Make LuCI OpenWrt web interface accessible via host LAN
: "${IS_U_OS_APP:=""}" # By default this container is not a u-OS app
: "${DEBUG:="N"}" # Disable debugging