aboutsummaryrefslogtreecommitdiffstats
path: root/dumpwatch.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'dumpwatch.zsh')
-rwxr-xr-xdumpwatch.zsh18
1 files changed, 18 insertions, 0 deletions
diff --git a/dumpwatch.zsh b/dumpwatch.zsh
new file mode 100755
index 0000000..a0b3de5
--- /dev/null
+++ b/dumpwatch.zsh
@@ -0,0 +1,18 @@
+#!/usr/bin/env zsh
+
+if [[ -z "$dump_host" ]]; then
+ dump_host=theos.kyriasis.com
+fi
+
+if [[ -z "$dump_user" ]]; then
+ dump_user="$USER"
+fi
+
+while read -r file; do
+ scp -q "$HOME"/dumpdir/"$file" "$dump_host":public_html/d/
+
+ url="https://$dump_host/~$dump_user/d/$file"
+ printf "Dumping file %s to %s. URL: %s\n" "$file" "$dump_host" "$url"
+ printf "%s\n" "$url" | xclip -selection clipboard
+
+done < <(inotifywait -me create --format '%f' "$HOME"/dumpdir)