outsource interaction part to separate file; better name scheming; update default status values; small improvements

This commit is contained in:
2016-11-23 12:14:47 +01:00
parent abd7cfb381
commit 42e41f3968
5 changed files with 108 additions and 85 deletions

21
shared-functions.so Normal file
View File

@@ -0,0 +1,21 @@
# SHARED FUNCTIONS AND COMMANDS
# Test if config.cfg exists and set needed variables
if [ ! -e "$CURDIR"/config.cfg ]; then echo "Missing config.cfg file. Edit and rename config.cfg.sample"; exit 1; fi
source "$CURDIR"/config.cfg
# Create temp settings file
if [ ! -e "$TMP" ]; then
touch "$TMP"
fi
source "$TMP"
# WRITE TMP
function wtmp {
> $TMP
echo "var_mailqueue_runs=$var_mailqueue_runs" >> $TMP
echo "var_conn=$var_conn" >> $TMP
echo "var_ip4=$var_ip4" >> $TMP
echo "var_ip6=$var_ip6" >> $TMP
echo "var_vpn=$var_vpn" >> $TMP
}