pass config_file as argv[1]
parent
eaabddc3a7
commit
0c935e3654
|
@ -23,7 +23,7 @@ A searchable package list is available on [openwrt.org](https://openwrt.org/pack
|
||||||
|
|
||||||
## Configure
|
## 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`.
|
To add or change a configuration, modify the config templates in `etc/config/<section>.tpl`.
|
||||||
|
|
||||||
|
|
7
run.sh
7
run.sh
|
@ -1,13 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# set -x
|
# set -x
|
||||||
|
|
||||||
source openwrt.conf || { echo 'no config file found! use openwrt.conf.example for inspiration'; exit 1; }
|
|
||||||
|
|
||||||
function _usage() {
|
function _usage() {
|
||||||
echo "$0 [interface_name]"
|
echo "Could not find config file."
|
||||||
|
echo "Usage: $0 [/path/to/openwrt.conf]"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CONFIG_FILE=${1:-"openwrt.conf"}
|
||||||
|
source $CONFIG_FILE 2>/dev/null || { _usage; exit 1; }
|
||||||
|
|
||||||
function _nmcli() {
|
function _nmcli() {
|
||||||
type nmcli >/dev/null 2>&1
|
type nmcli >/dev/null 2>&1
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
|
|
Loading…
Reference in New Issue