aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgosend43
-rwxr-xr-xphlogrss5
-rwxr-xr-xphlogthis4
3 files changed, 49 insertions, 3 deletions
diff --git a/gosend b/gosend
new file mode 100755
index 0000000..d2a844d
--- /dev/null
+++ b/gosend
@@ -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
+
diff --git a/phlogrss b/phlogrss
index 2b24856..1dd9af5 100755
--- a/phlogrss
+++ b/phlogrss
@@ -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
}
diff --git a/phlogthis b/phlogthis
index cef6049..08410e1 100755
--- a/phlogthis
+++ b/phlogthis
@@ -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