123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- function TRInsertFolder()
- {
- ILINE=$1
- showtimestr=`date "+%m/%d/%Y, %H:%M:%S %p"`
- dttime=`date "+%Y-%m-%dT%H:%M:%SZ" -d "-8 hours"`
- echo $ILINE
- # newline="\t\t\t\t\t<tr class=\"file\">\n"
- newline="\t\t\t\t\t<tr class=\"file\">"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td></td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t\t<a href=\"$2/\">"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t\t\t<svg width=\"1.5em\" height=\"1em\" version=\"1.1\" viewBox=\"0 0 317 259\"><use xlink:href=\"#folder\"></use></svg>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t\t\t<span class=\"name\">$2</span>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t\t</a>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t</td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td data-order=\"-1\">—</td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td class=\"hideable\"><time datetime=\"$dttime\">$showtimestr</time></td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td class=\"hideable\"></td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t</tr>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
-
- }
- function TRInsert()
- {
- ILINE=$1
- echo $ILINE
- # newline="\t\t\t\t\t<tr class=\"file\">\n"
- newline="\t\t\t\t\t<tr class=\"file\">"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td></td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t\t<a href=\"$2\">"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t\t\t<svg width=\"1.5em\" height=\"1em\" version=\"1.1\" viewBox=\"0 0 317 259\"><use xlink:href=\"#file\"></use></svg>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t\t\t<span class=\"name\">$2</span>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t\t</a>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t</td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td data-order=\"-1\">—</td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td class=\"hideable\"><time datetime=\"2022-02-27T12:42:28Z\">02/27/2022 12:42:28 PM +00:00</time></td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t\t<td class=\"hideable\"></td>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
- newline="\t\t\t\t\t</tr>"
- sed -i "$ILINE a\ $newline" index.html
- ILINE=$(($ILINE+1))
-
- }
- function CreateFolder()
- {
- folderdir=$1
- mkdir $folderdir
- cd $folderdir
- cp ../../template/index.html ./
- cd ..
- }
- folder=/mnt/nfs1
- echo $folder
- cd $folder
- cd AGXXavier
- index1path=$folder
- if [ -f "index.html" ]; then
- index1path=$folder"/AGXXavier/index.html"
- else
- echo " no index.html in AGXXavier."
- exit -1
- fi
- echo $index1path
- tbodyline=`sed -n '/<tbody>/=' index.html`
- trline=$(($tbodyline+11))
- echo $trline
- filename="index.html"
- month=`date +%Y.%m`
- if [ ! -d "$month" ]; then
- CreateFolder $month
- TRInsertFolder $trline $month
- fi
- #TRInsert $trline "file.zip"
- #sed -i "$trline a\ hello word" index.html
|