diff options
Diffstat (limited to 'net/gnunet/files/gnunet.init')
-rw-r--r-- | net/gnunet/files/gnunet.init | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/net/gnunet/files/gnunet.init b/net/gnunet/files/gnunet.init index c21bbd55c..aa8742295 100644 --- a/net/gnunet/files/gnunet.init +++ b/net/gnunet/files/gnunet.init @@ -47,6 +47,8 @@ prepare_config() { mkdir -p /etc/gnunet chown gnunet:gnunet /etc/gnunet } + + # defaults paths gnunet-config -c $CONFIGFILE -s PATHS -o GNUNET_CONFIG_HOME -V /etc/gnunet gnunet-config -c $CONFIGFILE -s PEER -o PRIVATE_KEY -V /etc/gnunet/private_key.ecc gnunet-config -c $CONFIGFILE -s identity -o EGODIR -V /etc/gnunet/identity/egos @@ -54,15 +56,6 @@ prepare_config() { gnunet-config -c $CONFIGFILE -s nse -o PROOFFILE -V /etc/gnunet/proof.dat gnunet-config -c $CONFIGFILE -s namestore-sqlite -o FILENAME -V /etc/gnunet/namestore.sqlite - # minimal datastore (todo: make this configurable) - gnunet-config -c $CONFIGFILE -s datastore -o QUOTA -V "4 MB" - - # limit dhtcache memory usage to 4 MB - gnunet-config -c $CONFIGFILE -s dhtcache -o QUOTA -V "4 MB" - - # enable dns2gns - gnunet-config -c $CONFIGFILE -s dns2gns -o AUTOSTART -V YES - # enable all installed transport plugins transport_plugins=$(gnunet-config -c $CONFIGFILE -s transport -o PLUGINS) for transplug in /usr/lib/gnunet/libgnunet_plugin_transport_*.so; do @@ -72,6 +65,28 @@ prepare_config() { transport_plugins="$transport_plugins $transplug" done gnunet-config -c $CONFIGFILE -s transport -o PLUGINS -V "$transport_plugins" + + # apply config from UCI + _gnunet_section="" + config_cb() + { + # $1 "Type" + # $2 "Name" + local __TYPE="$1" + local __NAME="$2" + [ "${__TYPE}" = "gnunet-config" ] && _gnunet_section="${__NAME}" + [ "${__TYPE}" = "gnunet-exit-service" ] && _gnunet_section="${__NAME}.gnunet." + } + option_cb() { + # $1 name of variable + # $2 value + local __OPT="$1" + local __VAL="$2" + gnunet-config -c $CONFIGFILE -s ${_gnunet_section} -o ${__OPT} -V "${__VAL}" + } + config_load gnunet + + return 0 } start_service() { |