Changeset 344 for trunk/push-web


Ignore:
Timestamp:
Nov 1, 2017, 7:24:34 AM (7 years ago)
Author:
g7moreau
Message:
  • Many small improvment and error &nbsp ->   ...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/push-web

    r343 r344  
    55# 2011/03/30 gabriel - make it generic
    66
     7export PATH=/bin:/sbin:/usr/bin:/usr/sbin
     8export LANG=C
     9
    710SITE_NAME=''
    811REMOTE_SERVER=localhost
     
    2124
    2225
    23 # local command
    24 MKDIR=/bin/mkdir
    25 DATE=/bin/date
    26 CAT=/bin/cat
    27 TAIL=/usr/bin/tail
    28 HEAD=/usr/bin/head
    29 SSH=/usr/bin/ssh
    30 SCP=/usr/bin/scp
    31 KLASK=/usr/sbin/klask
    32 RSYNC=/usr/bin/rsync
    33 
    3426# remote command
    3527DOT=/usr/bin/dot
    3628
    3729
    38 $MKDIR -p ${TMP}
     30mkdir -p ${TMP}
    3931if [ ! -d ${TMP} ]
    4032then
     
    4537
    4638
    47 LOCALTIME=$($DATE "+%Y-%m-%d %H:%M")
    48 
    49 
    50 $KLASK exportsw --format dot --modulo ${GRAPH_MODULO} --shift ${GRAPH_SHIFT} > ${TMP}/switch-map.txt
    51 
    52 
    53 $KLASK exportdb    > ${TMP}/hostname-db.txt
    54 $KLASK exportsw    > ${TMP}/switch-db.txt
    55 $KLASK ip-free     > ${TMP}/ipfree-db.txt
    56 $KLASK bad-vlan-id > ${TMP}/badvlan-db.txt
    57 
    58 
    59 $CAT <<END > ${TMP}/index.html
     39LOCALTIME=$(date "+%Y-%m-%d %H:%M")
     40
     41
     42klask exportsw --format dot --modulo ${GRAPH_MODULO} --shift ${GRAPH_SHIFT} > ${TMP}/switch-map.txt
     43
     44
     45klask exportdb    > ${TMP}/hostname-db.txt
     46klask exportsw    > ${TMP}/switch-db.txt
     47klask ip-free     > ${TMP}/ipfree-db.txt
     48klask bad-vlan-id > ${TMP}/badvlan-db.txt
     49
     50
     51cat <<END > ${TMP}/index.html
    6052<html>
    6153<head>
     
    8678  <li id="selected"><a href="index.html">IP detected</a></li>
    8779  <li><a href="ip-free.html">IP available</a></li>
    88   <li><a href="bad-vlan-id.html">Bad VLAN ID</a></li>
     80  <li><a href="bad-vlan-id.html">VLAN mismatch</a></li>
    8981 </ul>
    9082</div>
     
    9385<p>
    9486The main raw results of Klask are accessible directly, via wget or curl for example, for a specific treatment:
    95 <a href="hostname-db.txt">Computers</a>,
    96 <a href="switch-db.txt">Switches</a>,
     87<a href="hostname-db.txt">Computers DB</a>,
     88<a href="switch-db.txt">Switches DB</a>,
    9789<a href="ipfree-db.txt">IP available</a>,
    98 <a href="badvlan-db.txt">Bad VLAN ID</a>,
    99 <a href="switch-map.txt">Map</a>.
    100 </p>
    101 END
    102 
    103 $KLASK exportdb --format html >> ${TMP}/index.html
    104 
    105 $CAT <<END >> ${TMP}/index.html
     90<a href="badvlan-db.txt">VLAN mismatch</a>,
     91<a href="switch-map.txt">Map dot source</a>.
     92</p>
     93END
     94
     95klask exportdb --format html >> ${TMP}/index.html
     96
     97cat <<END >> ${TMP}/index.html
    10698</div>
    10799<p class="copyright">
     
    113105
    114106
    115 $CAT <<END > ${TMP}/ip-free.html
     107cat <<END > ${TMP}/ip-free.html
    116108<html>
    117109<head>
     
    131123  <li><a href="index.html">IP detected</a></li>
    132124  <li id="selected"><a href="ip-free.html">IP available</a></li>
    133   <li><a href="bad-vlan-id.html">Bad VLAN ID</a></li>
     125  <li><a href="bad-vlan-id.html">VLAN mismatch</a></li>
    134126 </ul>
    135127</div>
     
    138130<p>
    139131The main raw results of Klask are accessible directly, via wget or curl for example, for a specific treatment:
    140 <a href="hostname-db.txt">Computers</a>,
    141 <a href="switch-db.txt">Switches</a>,
     132<a href="hostname-db.txt">Computers DB</a>,
     133<a href="switch-db.txt">Switches DB</a>,
    142134<a href="ipfree-db.txt">IP available</a>,
    143 <a href="bad-vlan-id-db.txt">Bad VLAN ID</a>,
    144 <a href="switch-map.txt">Map</a>.
    145 </p>
    146 END
    147 
    148 $KLASK ip-free --format html >> ${TMP}/ip-free.html
    149 
    150 $CAT <<END >> ${TMP}/ip-free.html
     135<a href="bad-vlan-id-db.txt">VLAN mismatch</a>,
     136<a href="switch-map.txt">Map dot source</a>.
     137</p>
     138END
     139
     140klask ip-free --format html >> ${TMP}/ip-free.html
     141
     142cat <<END >> ${TMP}/ip-free.html
    151143</div>
    152144<p class="copyright">
     
    158150
    159151
    160 $CAT <<END > ${TMP}/bad-vlan-id.html
     152cat <<END > ${TMP}/bad-vlan-id.html
    161153<html>
    162154<head>
     
    176168  <li><a href="index.html">IP detected</a></li>
    177169  <li><a href="ip-free.html">IP available</a></li>
    178   <li id="selected"><a href="bad-vlan-id.html">Bad VLAN ID</a></li>
     170  <li id="selected"><a href="bad-vlan-id.html">VLAN mismatch</a></li>
    179171 </ul>
    180172</div>
     
    183175<p>
    184176The main raw results of Klask are accessible directly, via wget or curl for example, for a specific treatment:
    185 <a href="hostname-db.txt">Computers</a>,
    186 <a href="switch-db.txt">Switches</a>,
     177<a href="hostname-db.txt">Computers DB</a>,
     178<a href="switch-db.txt">Switches DB</a>,
    187179<a href="ipfree-db.txt">IP available</a>,
    188 <a href="bad-vlan-id-db.txt">Bad VLAN ID</a>,
    189 <a href="switch-map.txt">Map</a>.
    190 </p>
    191 END
    192 
    193 $KLASK bad-vlan-id --format html >> ${TMP}/bad-vlan-id.html
    194 
    195 $CAT <<END >> ${TMP}/bad-vlan-id.html
     180<a href="bad-vlan-id-db.txt">VLAN mismatch</a>,
     181<a href="switch-map.txt">Map dot source</a>.
     182</p>
     183END
     184
     185klask bad-vlan-id --format html >> ${TMP}/bad-vlan-id.html
     186
     187cat <<END >> ${TMP}/bad-vlan-id.html
    196188</div>
    197189<p class="copyright">
     
    205197if [ "${REMOTE_SERVER}" = "localhost" ]
    206198then
    207    $RSYNC \
     199   rsync \
    208200      /usr/share/klask/sorttable-klask.js \
    209201      /usr/share/klask/style-klask.css \
     
    218210
    219211else
    220    $RSYNC \
     212   rsync \
    221213      /usr/share/klask/sorttable-klask.js \
    222214      /usr/share/klask/style-klask.css \
     
    229221
    230222
    231    $SSH ${REMOTE_USER}@${REMOTE_SERVER} "(cd ${REMOTE_FOLDER}; ${DOT} -T svg switch-map.txt > switch-map.svg; ${DOT} -T png switch-map.txt > switch-map.png)"
     223   ssh ${REMOTE_USER}@${REMOTE_SERVER} "(cd ${REMOTE_FOLDER}; ${DOT} -T svg switch-map.txt > switch-map.svg; ${DOT} -T png switch-map.txt > switch-map.png)"
    232224fi
Note: See TracChangeset for help on using the changeset viewer.