mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
iiab_env_file -> {{ iiab_env_file }} or "{{ iiab_env_file }}"
This commit is contained in:
parent
d9c73cc804
commit
b973906dc3
18 changed files with 23 additions and 23 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Use these to tag a release at a point in time, for /etc/iiab/iiab.env
|
# Use these to tag a release at a point in time, for {{ iiab_env_file }}
|
||||||
iiab_base_ver: 6.7
|
iiab_base_ver: 6.7
|
||||||
iiab_revision: 0
|
iiab_revision: 0
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
def get_iiab_env(name):
|
def get_iiab_env(name):
|
||||||
""" read iiab.env file for a value, return "" if does not exist"""
|
""" read iiab.env file for a value, return "" if does not exist"""
|
||||||
try:
|
try:
|
||||||
fd = open("/etc/iiab/iiab.env","r")
|
fd = open("{{ iiab_env_file }}","r")
|
||||||
for line in fd:
|
for line in fd:
|
||||||
line = line.lstrip()
|
line = line.lstrip()
|
||||||
line = line.rstrip('\n')
|
line = line.rstrip('\n')
|
||||||
|
|
|
@ -15,7 +15,7 @@ fi
|
||||||
if [[ $(grep -i raspbian /etc/*release) &&
|
if [[ $(grep -i raspbian /etc/*release) &&
|
||||||
#($(grep "hostapd_enabled = False" /etc/iiab/config_vars.yml) ||
|
#($(grep "hostapd_enabled = False" /etc/iiab/config_vars.yml) ||
|
||||||
#((! $(grep "hostapd_enabled = True" /etc/iiab/config_vars.yml)) &&
|
#((! $(grep "hostapd_enabled = True" /etc/iiab/config_vars.yml)) &&
|
||||||
! $(grep "^HOSTAPD_ENABLED=True" /etc/iiab/iiab.env) ]];
|
! $(grep "^HOSTAPD_ENABLED=True" {{ iiab_env_file }}) ]];
|
||||||
# NEGATED LOGIC HELPS FORCE PROMISCUOUS MODE EARLY IN INSTALL
|
# NEGATED LOGIC HELPS FORCE PROMISCUOUS MODE EARLY IN INSTALL
|
||||||
# (when network/tasks/main.yml hasn't yet populated iiab.env)
|
# (when network/tasks/main.yml hasn't yet populated iiab.env)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Pull down repo's entire wiki (and similar) to create offline docs
|
# Pull down repo's entire wiki (and similar) to create offline docs
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
source /etc/iiab/iiab.env
|
source {{ iiab_env_file }}
|
||||||
INPUT=/tmp/iiab-wiki
|
INPUT=/tmp/iiab-wiki
|
||||||
OUTPUT=/tmp/iiab-wiki.out
|
OUTPUT=/tmp/iiab-wiki.out
|
||||||
DESTPATH=/library/www/html/info
|
DESTPATH=/library/www/html/info
|
||||||
|
|
|
@ -29,7 +29,7 @@ if not IIAB_PATH in sys.path:
|
||||||
from iiab_env import get_iiab_env
|
from iiab_env import get_iiab_env
|
||||||
|
|
||||||
# Config Files
|
# Config Files
|
||||||
# iiab_ini_file should be in /etc/iiab/iiab.env
|
# iiab_ini_file should be in {{ iiab_env_file }}
|
||||||
iiab_ini_file = "{{ iiab_ini_file }}" # nominally /etc/iiab/iiab.ini
|
iiab_ini_file = "{{ iiab_ini_file }}" # nominally /etc/iiab/iiab.ini
|
||||||
# iiab_ini_file = "/etc/iiab/iiab.ini" # comment out after testing
|
# iiab_ini_file = "/etc/iiab/iiab.ini" # comment out after testing
|
||||||
|
|
||||||
|
|
|
@ -172,9 +172,9 @@
|
||||||
iiab_wan_iface: "none"
|
iiab_wan_iface: "none"
|
||||||
when: adapter_count.stdout|int >= "5" and device_gw == "none" and gui_wan_iface == "unset" and gui_static_wan is defined
|
when: adapter_count.stdout|int >= "5" and device_gw == "none" and gui_wan_iface == "unset" and gui_static_wan is defined
|
||||||
|
|
||||||
- name: Record IIAB_WAN_DEVICE to /etc/iiab/iiab.env
|
- name: Record IIAB_WAN_DEVICE to {{ iiab_env_file }}
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/iiab/iiab.env
|
dest: "{{ iiab_env_file }}"
|
||||||
regexp: '^IIAB_WAN_DEVICE=*'
|
regexp: '^IIAB_WAN_DEVICE=*'
|
||||||
line: 'IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"'
|
line: 'IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"'
|
||||||
state: present
|
state: present
|
||||||
|
@ -182,9 +182,9 @@
|
||||||
tags:
|
tags:
|
||||||
- network
|
- network
|
||||||
|
|
||||||
- name: Record IIAB_LAN_DEVICE to /etc/iiab/iiab.env
|
- name: Record IIAB_LAN_DEVICE to {{ iiab_env_file }}
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/iiab/iiab.env
|
dest: "{{ iiab_env_file }}"
|
||||||
regexp: '^IIAB_LAN_DEVICE=*'
|
regexp: '^IIAB_LAN_DEVICE=*'
|
||||||
line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"'
|
line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"'
|
||||||
state: present
|
state: present
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
- name: iiab_wan_device
|
- name: iiab_wan_device
|
||||||
shell: grep IIAB_WAN_DEVICE /etc/iiab/iiab.env | awk -F "=" '{print $2}'
|
shell: grep IIAB_WAN_DEVICE {{ iiab_env_file }} | awk -F "=" '{print $2}'
|
||||||
when: iiab_stage|int > 4
|
when: iiab_stage|int > 4
|
||||||
register: prior_gw
|
register: prior_gw
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
|
|
||||||
- name: Create xs_httpcache flag
|
- name: Create xs_httpcache flag
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/iiab/iiab.env
|
dest: "{{ iiab_env_file }}"
|
||||||
regexp: '^HTTPCACHE_ON=*'
|
regexp: '^HTTPCACHE_ON=*'
|
||||||
line: 'HTTPCACHE_ON=True'
|
line: 'HTTPCACHE_ON=True'
|
||||||
state: present
|
state: present
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
|
|
||||||
- name: Remove xs_httpcache flag
|
- name: Remove xs_httpcache flag
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/iiab/iiab.env
|
dest: "{{ iiab_env_file }}"
|
||||||
regexp: '^HTTPCACHE_ON=*'
|
regexp: '^HTTPCACHE_ON=*'
|
||||||
line: 'HTTPCACHE_ON=False'
|
line: 'HTTPCACHE_ON=False'
|
||||||
state: present
|
state: present
|
||||||
|
|
|
@ -55,9 +55,9 @@
|
||||||
enabled: yes
|
enabled: yes
|
||||||
when: hostapd_enabled and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance"
|
when: hostapd_enabled and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance"
|
||||||
|
|
||||||
- name: Record HOSTAPD_ENABLED to /etc/iiab/iiab.env
|
- name: Record HOSTAPD_ENABLED to {{ iiab_env_file }}
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/iiab/iiab.env
|
dest: "{{ iiab_env_file }}"
|
||||||
regexp: '^HOSTAPD_ENABLED=*'
|
regexp: '^HOSTAPD_ENABLED=*'
|
||||||
line: 'HOSTAPD_ENABLED={{ hostapd_enabled }}'
|
line: 'HOSTAPD_ENABLED={{ hostapd_enabled }}'
|
||||||
state: present
|
state: present
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
no_net_restart: True # used below in (1) sysd-netd-debian.yml,
|
no_net_restart: True # used below in (1) sysd-netd-debian.yml,
|
||||||
# (2) debian.yml, (3) rpi_debian.yml
|
# (2) debian.yml, (3) rpi_debian.yml
|
||||||
when: discovered_wireless_iface == iiab_wan_iface and not reboot_to_AP
|
when: discovered_wireless_iface == iiab_wan_iface and not reboot_to_AP
|
||||||
# EITHER WAY: hostapd_enabled's state is RECORDED into /etc/iiab/iiab.env
|
# EITHER WAY: hostapd_enabled's state is RECORDED into {{ iiab_env_file }}
|
||||||
# in hostapd.yml for later use by...
|
# in hostapd.yml for later use by...
|
||||||
# /usr/libexec/iiab-startup.sh, iiab-hotspot-off & iiab-hotspot-on
|
# /usr/libexec/iiab-startup.sh, iiab-hotspot-off & iiab-hotspot-on
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash -x
|
#!/bin/bash -x
|
||||||
source /etc/iiab/iiab.env
|
source {{ iiab_env_file }}
|
||||||
{% if is_debuntu %}
|
{% if is_debuntu %}
|
||||||
IPTABLES=/sbin/iptables
|
IPTABLES=/sbin/iptables
|
||||||
IPTABLES_DATA=/etc/iptables.up.rules
|
IPTABLES_DATA=/etc/iptables.up.rules
|
||||||
|
|
|
@ -16,4 +16,4 @@ if grep -qi raspbian /etc/*release; then
|
||||||
ip link set dev wlan0 promisc on
|
ip link set dev wlan0 promisc on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" /etc/iiab/iiab.env
|
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=False/" {{ iiab_env_file }}
|
||||||
|
|
|
@ -17,6 +17,6 @@ if grep -qi raspbian /etc/*release; then
|
||||||
ip link set dev wlan0 promisc off
|
ip link set dev wlan0 promisc off
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" /etc/iiab/iiab.env
|
sed -i -e "s/^HOSTAPD_ENABLED.*/HOSTAPD_ENABLED=True/" {{ iiab_env_file }}
|
||||||
|
|
||||||
echo -e "\nPlease consider rebooting now.\n"
|
echo -e "\nPlease consider rebooting now.\n"
|
||||||
|
|
|
@ -19,7 +19,7 @@ if [ -f /etc/iiab/openvpn_handle ]; then
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# # Option #3: Dangerous to invoke hypothetical variables :(
|
# # Option #3: Dangerous to invoke hypothetical variables :(
|
||||||
# source /etc/iiab/iiab.env
|
# source {{ iiab_env_file }}
|
||||||
# # Option #4: CAUSED FAILURES IN AUGUST 2018, invoking stale variable from /etc/iiab/iiab.ini, but safer now that relegated to #4 ?
|
# # Option #4: CAUSED FAILURES IN AUGUST 2018, invoking stale variable from /etc/iiab/iiab.ini, but safer now that relegated to #4 ?
|
||||||
# if [ -z "$HANDLE" ]; then
|
# if [ -z "$HANDLE" ]; then
|
||||||
# HANDLE=`cat /etc/iiab/iiab.ini | gawk \
|
# HANDLE=`cat /etc/iiab/iiab.ini | gawk \
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
- name: Put variable in iiab.env that enables display of content at root of USB
|
- name: Put variable in iiab.env that enables display of content at root of USB
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/iiab/iiab.env
|
dest: "{{ iiab_env_file }}"
|
||||||
regexp: "^IIAB_USB_LIB_SHOW_ALL.*"
|
regexp: "^IIAB_USB_LIB_SHOW_ALL.*"
|
||||||
line: "IIAB_USB_LIB_SHOW_ALL={{ iiab_usb_lib_show_all }}"
|
line: "IIAB_USB_LIB_SHOW_ALL={{ iiab_usb_lib_show_all }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# turn on the flag which registers new USB sticks at root directory
|
# turn on the flag which registers new USB sticks at root directory
|
||||||
|
|
||||||
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=False/' /etc/iiab/iiab.env
|
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=False/' {{ iiab_env_file }}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# turn on the flag which registers new USB sticks at root directory
|
# turn on the flag which registers new USB sticks at root directory
|
||||||
|
|
||||||
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=True/' /etc/iiab/iiab.env
|
sed -i -e's/^IIAB_USB_LIB_SHOW_ALL.*/IIAB_USB_LIB_SHOW_ALL=True/' {{ iiab_env_file }}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#
|
#
|
||||||
# by Tim Moody tim@timmoody.com
|
# by Tim Moody tim@timmoody.com
|
||||||
|
|
||||||
source /etc/iiab/iiab.env
|
source {{ iiab_env_file }}
|
||||||
case $IIAB_USB_LIB_SHOW_ALL in
|
case $IIAB_USB_LIB_SHOW_ALL in
|
||||||
'True'|'true'|'TRUE')
|
'True'|'true'|'TRUE')
|
||||||
logger -p user.notice -t "70-usb-library" -- "Displaying root directory on $UM_MOUNTPOINT."
|
logger -p user.notice -t "70-usb-library" -- "Displaying root directory on $UM_MOUNTPOINT."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue