Commit 6c14611b authored by Alessandro Rubini's avatar Alessandro Rubini

build: configure snmpd at run-time, not build-time

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 7187ce93
...@@ -47,14 +47,6 @@ rm -rf $TMPFS/dev ...@@ -47,14 +47,6 @@ rm -rf $TMPFS/dev
(cd $TMPFS && tar xzf $DEVTAR) (cd $TMPFS && tar xzf $DEVTAR)
(cd $TMPFS && ln -fs sbin/init .) (cd $TMPFS && ln -fs sbin/init .)
# Fix SNMP values: for all not-empty configs remove commend and replace value
cfgfile="$TMPFS/wr/etc/snmpd.conf"
set | grep CONFIG_SNMP | sed 's/=/ /' | while read varname value; do
if [ -z "\$value" ]; then continue; fi
sed -i "/\$varname/ s/^#//" \$cfgfile
sed -i "/\$varname/ s/\$varname/\$value/" \$cfgfile
done
# Fix log values # Fix log values
cfgfile="$TMPFS/wr/sbin/start-daemons.sh" cfgfile="$TMPFS/wr/sbin/start-daemons.sh"
set | grep CONFIG_WRS_LOG | sed 's/=/ /' | while read varname value; do set | grep CONFIG_WRS_LOG | sed 's/=/ /' | while read varname value; do
......
...@@ -58,4 +58,11 @@ if [ ! -z "$CONFIG_REMOTE_SYSLOG_SERVER" ]; then ...@@ -58,4 +58,11 @@ if [ ! -z "$CONFIG_REMOTE_SYSLOG_SERVER" ]; then
fi fi
copy_conf /etc/rsyslog.conf /usr/etc/rsyslog.conf copy_conf /etc/rsyslog.conf /usr/etc/rsyslog.conf
# Fix SNMP values: for all not-empty configs remove comment and replace value
cp /wr/etc/snmpd.conf.in $T
set | grep CONFIG_SNMP | sed 's/=/ /' | while read varname value; do
if [ -z "$value" ]; then continue; fi
sed -i "/$varname/ s/^#//" $T
sed -i "/$varname/ s/$varname/$value/" $T
done
copy_conf /wr/etc/snmpd.conf
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment