summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpublish20
1 files changed, 18 insertions, 2 deletions
diff --git a/publish b/publish
index 4d4a4f6..2dab69e 100755
--- a/publish
+++ b/publish
@@ -83,6 +83,7 @@ OPTIONS:
-t days time to live in days
-T tag directory name on the server (use this to re-publish under that name)
-x Publish the contents of the xclipboard.
+ -u Unpublish directory (only useful together with -T)
EOF
}
@@ -121,8 +122,10 @@ do_screenshot=0
make_qrcode=0
add_default_cs=0
relative=""
+d_server=""
+unpublish=0
-while getopts "rhnq8HSxs:t:T:" OPTION
+while getopts "rhnq8HSxs:t:T:u" OPTION
do
case $OPTION in
h)
@@ -165,6 +168,9 @@ do
T)
d_server="$OPTARG"
;;
+ u)
+ unpublish=1
+ ;;
*)
usage >&2
exit 1
@@ -176,6 +182,17 @@ shift $(($OPTIND - 1))
tmpdir=""
+if [ "$unpublish" -gt 0 ] ; then
+ if [ -z "$d_server" ]; then
+ echo "Option -u only makes sense together with -T."
+ exit 1
+ fi
+ setup_tmpdir
+ $NODO rsync --recursive $rsync_args $relative --delete -v "$tmpdir/." $base_rsync"/$d_server/"
+ exit
+fi
+
+
if [[ "$do_screenshot" -gt 0 ]]; then
setup_tmpdir
img="$tmpdir/screenshot.png"
@@ -240,7 +257,6 @@ else
echo "$main_uri"
fi
-
publish_pre_invoke
if [ "$make_qrcode" -gt 0 ] ; then