diff options
-rwxr-xr-x | gosend | 43 | ||||
-rwxr-xr-x | phlogrss | 5 | ||||
-rwxr-xr-x | phlogthis | 4 |
3 files changed, 49 insertions, 3 deletions
@@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# gosend : scp files to gopher server +# requires : pb https://git.wittamore.com/bashlib/tree +# usage : gosend hours (if not set default is 1 hour) +# example : gosend 72 sends files modified over the past 3 days + +source ~/.local/bashlib/pb_number +source ~/.local/bashlib/pb_colour + +# folders +rf=spike:/srv/gopher +mf=$HOME/src/gopher +cd $mf || exit + +# test if $1 +if [ -z "$1" ]; then + printf %b "$(pb_fg 196)no parameter, using 1$(pb_nc)\n" + hours=1; +else + # test if $1 is a number + if [ "$1" -eq "$1" ] >/dev/null 2>&1; then + hours="$1"; + else + printf %b "$(pb_fg 196)bad parameter, using 1$(pb_nc)\n" + hours=1; + fi +fi + +minutes=$((hours*60)) + +printf "Sending files modified in the past $hours hour(s) to $rf\n" + +files=$(find -- * -iname "*.html" -path .tmp -prune -o -mmin -$minutes -type f) +for file in $files +do + printf %s "-> "; scp "$file" "$rf/$file"; +done + +printf "Done.\n" + +exit 0 + @@ -1,4 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash + +# create a gopher rss feed phloglink="gopher://spike.nagatha.fr/0/phlog" description="Phil's Phlog" @@ -24,7 +26,6 @@ echo " footer () { echo " </channel> - </rss> " >> ~/feedbottom } @@ -1,6 +1,8 @@ #!/bin/bash -# create text, assemble html file, add to articles +# create phlog entry, rebuild gophermap +# requires par for text formatting + root=$HOME/src/gopher/phlog |