- #!/usr/bin/env bash
- echo "looking for prior status.."
- sleep 1
- if [ -f tmp/old ];
- then echo "status found, previous contents:";
- sleep 1
- else echo "status not found, creating base - current contents:";
- sleep 1
- ls images > tmp/old;
- fi
- old=$(cat tmp/old)
- echo $old
- sleep 1
- echo ""
- echo "searching for new files"
- sleep 1
- new=$(find images/ -newer tmp/old | sed '1d')
- echo "new file/s found:"
- sleep 1
- echo $new
- sleep 1
- path=$new
- name=$(ls images | grep new)
- echo ""
- echo "creating new link;"
- sleep 1
- link='<ul><li><a href='$path'>'$name'</a></li></ul>'
- echo $link
- echo ""
- sleep 1
- echo "adding link to test.html:"
- sleep 1
- echo ""
- sed '/navbar/a '$link'' test.html