Skip to content

Commit

Permalink
Additional Logging with timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
pocki80 authored Mar 22, 2018
1 parent 73f2df4 commit 88c48a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions wizard-run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#
# EdgeMAX Wizard "OLSRd_V1" created 03/2016 by Onetrix.net for FunkFeuer.at
# Version [0903k/201801261]
# Version [0903k/201803220]
# ^-- previous line is used from bmk-webstatus-package as version identification, dont remove "Version "
#
# Github repository: https://github.com/vchrizz/ER-wizard-OLSRd_V1/
Expand Down Expand Up @@ -122,6 +122,7 @@ if [ $(echo -n I | od -to2 | awk '{ print substr($2,6,1); exit}') == 0 ]; then
else
arch='mipsel'
fi
echo "Running olsrdsetupscriptfile script... $(date +%Y-%m-%d/%H:%M:%S.%N)" >>$log
# both packages, olsrd *and* olsrd-plugins are required and must be specified!
# german debian mirror
olsrdmirror="http://ftp.de.debian.org/debian/pool/main/o/olsrd/olsrd_0.6.6.2-1_$arch.deb"
Expand Down Expand Up @@ -191,6 +192,7 @@ fi
# restart daemon(s)
$olsrd4init restart >>$log
$olsrd6init restart >>$log
echo "Finished olsrdsetupscriptfile script... $(date +%Y-%m-%d/%H:%M:%S.%N)" >>$log
exit 0
ENDSCRIPTCONTENT
}
Expand All @@ -200,7 +202,7 @@ writewatchdogscript () {
echo "installing /etc/olsrdwatchdog" >>$log
cat >$olsrdwatchdogscriptfile <<'ENDSCRIPTCONTENT'
#!/bin/bash
#init.d script of oslr creates/deletes the compare file to enable/disable this watchdog
#init.d script of olsrd creates/deletes the compare file to enable/disable this watchdog
olsrd4config="/config/user-data/olsrd4.conf"
LOG="/tmp/olsrd.log"
UG=$(echo $(id -un):$(id -u) "("$(id -gn):$(id -g)")")
Expand Down Expand Up @@ -233,6 +235,8 @@ ENDSCRIPTCONTENT
# they will be extracted into $cfgusrdir at first run of this script.
#

echo "Starting Wizard-Installation Block ... $(date +%Y-%m-%d/%H:%M:%S.%N)" >>$log

# migrate logfile to new location
if [ -f olsrd-install.log ]; then
echo "--start migrated olsrd-install.log:">>$log
Expand Down Expand Up @@ -19332,6 +19336,9 @@ e/xD9v/y++6/l/U/A+ZS9vhH/f/R76PfR7+PfvD7v0dDy1sASA0ACg==
" | base64 -d > $cfgusrdir/olsrd-plugins_0.9.0.3-1_mipsel.deb
if [[ $? == 0 ]]; then echo "extracted $arch olsrd-plugins." >>$log; else echo "extraction of $arch olsrd-plugins failed" >>$log; fi
fi

echo "Finished Wizard-Installation Block ... $(date +%Y-%m-%d/%H:%M:%S.%N)" >>$log

sed -i '/^#base64begin/,/^#base64end$/d' $0
# !dont edit or remove this comment!
#base64end
Expand Down Expand Up @@ -19389,6 +19396,7 @@ function valid_ip() {

# function to download (if not found in $cfgusrdir) and install olsrd
installolsrd () {
echo "Running installolsrd() procedure... $(date +%Y-%m-%d/%H:%M:%S.%N)" >>$log
version_latest_ondisk=$(ls /config/user-data/olsrd_*_${arch}.deb | cut -d_ -f2 | sort -r | head -1)
if [ -n ${version_latest_ondisk} ]; then
ver=${version_latest_ondisk}
Expand Down Expand Up @@ -19457,6 +19465,7 @@ installolsrd () {
}

setupv4olsrd () {
echo "Running setupv4olsrd() procedure... $(date +%Y-%m-%d/%H:%M:%S.%N)" >>$log
if [[ -w $cfgusrdir$(basename $olsrd4default).default ]]; then
cp -f $cfgusrdir$(basename $olsrd4default).default $olsrd4default 2> /dev/null
fi
Expand Down Expand Up @@ -19523,6 +19532,7 @@ UG=$(echo $(id -un):$(id -u) "("$(id -gn):$(id -g)")")' $olsrd4init
# because olsrd runs only in ipv4 *OR* ipv6 mode
# (olsrd2 is able to run v4 and v6 in one instance)
setupv6olsrd () {
echo "Running setupv6olsrd() procedure... $(date +%Y-%m-%d/%H:%M:%S.%N)" >>$log
if [[ -w $cfgusrdir$(basename $olsrd6default).default ]]; then
cp -f $cfgusrdir$(basename $olsrd6default).default $olsrd6default 2> /dev/null
defrunlvl=$(grep initdefault /etc/inittab | cut -d: -f2)
Expand Down
4 changes: 2 additions & 2 deletions wizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
EdgeMAX Wizard "OLSRd_V1" created 03/2016 by Onetrix.net for FunkFeuer.at
Works on EdgeRouter and EdgeRouter X / X-SFP (system version 1.7.0+)
versioninfo=201801260
versioninfo=201803220
^-- use version identifier as number: YYYYMMDDX whereas X can be intraday-version
autoupdate=201801260
^-- set autoupdate the same version identifier to allow autoupdates
Expand All @@ -15,7 +15,7 @@ <h3>Optimized Link State Routing Protocol</h3>
</div>
<legend style="position:absolute;right:0px;padding:5px;">
<center>EdgeMAX Wizard "OLSRd_V1" created 2016<br>by <a href="http://onetrix.net" target="_blank">Onetrix.net</a> for <a href="http://funkfeuer.at" target="_blank">FunkFeuer.at</a>
<br>Version [0903k/20180126]</center>
<br>Version [0903k/20180322]</center>
</legend>
<div style="padding:15px;border: 1px solid lightgray;width:648px">
<table border="0">
Expand Down

0 comments on commit 88c48a7

Please sign in to comment.