|
@@ -0,0 +1,137 @@
|
|
|
+
|
|
|
+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
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|