pass config_file as argv[1]

pull/1/head
Jordan Sokolic 2020-02-21 08:47:18 +02:00
parent eaabddc3a7
commit 0c935e3654
2 changed files with 6 additions and 3 deletions

View File

@ -23,7 +23,7 @@ A searchable package list is available on [openwrt.org](https://openwrt.org/pack
## Configure
Configuration is performed using a config file, `.env`. Values read from this file at runtime are used to generate OpenWRT format config files.
Configuration is performed using a config file, `openwrt.conf`. Values read from this file at runtime are used to generate OpenWRT format config files.
To add or change a configuration, modify the config templates in `etc/config/<section>.tpl`.

7
run.sh
View File

@ -1,13 +1,16 @@
#!/bin/bash
# set -x
source openwrt.conf || { echo 'no config file found! use openwrt.conf.example for inspiration'; exit 1; }
function _usage() {
echo "$0 [interface_name]"
echo "Could not find config file."
echo "Usage: $0 [/path/to/openwrt.conf]"
exit 1
}
CONFIG_FILE=${1:-"openwrt.conf"}
source $CONFIG_FILE 2>/dev/null || { _usage; exit 1; }
function _nmcli() {
type nmcli >/dev/null 2>&1
if [[ $? -eq 0 ]]; then