2023-04-04 07:00:31 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-01-23 17:43:08 +00:00
|
|
|
|
2015-01-23 17:47:31 +00:00
|
|
|
cd "$(dirname "$0")"/..
|
|
|
|
|
2017-11-13 16:13:03 +00:00
|
|
|
date-string() {
|
|
|
|
date
|
|
|
|
}
|
|
|
|
wrapper() {
|
|
|
|
echo -n "*** $(cat) ***"
|
|
|
|
}
|
2015-01-23 17:43:08 +00:00
|
|
|
|
2015-01-28 09:25:51 +00:00
|
|
|
export IP=127.0.0.1
|
|
|
|
export ALLOWED_HOSTS=( 192.168.0.1 192.168.0.2 192.168.0.3 )
|
2015-01-23 17:43:08 +00:00
|
|
|
|
2017-11-13 16:13:03 +00:00
|
|
|
. ./mo # Keep in mind this script is executing in the parent directory
|
2015-08-27 14:44:04 +00:00
|
|
|
cat <<EOF | mo
|
2015-01-23 17:43:08 +00:00
|
|
|
# {{#wrapper}}OH SO IMPORTANT{{/wrapper}}
|
|
|
|
# This file automatically generated at {{date-string}}
|
|
|
|
home_ip={{IP}}
|
|
|
|
|
|
|
|
# ALLOWED HOSTS
|
|
|
|
{{#ALLOWED_HOSTS}}allowed_host={{.}}
|
2015-01-23 18:07:30 +00:00
|
|
|
{{/ALLOWED_HOSTS}}{{^ALLOWED_HOSTS}}# No allowed hosts{{/ALLOWED_HOSTS}}
|
2015-01-23 17:43:08 +00:00
|
|
|
|
|
|
|
# DENIED HOSTS
|
|
|
|
{{#DENIED_HOSTS}}denied_host={{.}}
|
2015-01-23 18:07:30 +00:00
|
|
|
{{/DENIED_HOSTS}}{{^DENIED_HOSTS}}# No denied hosts{{/DENIED_HOSTS}}
|
2015-01-23 17:43:08 +00:00
|
|
|
EOF
|