From c6b1bb22730ae1a28ca4d1ebe56b48e1a87d442a Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 7 May 2013 14:02:39 +0000 Subject: Add unpublish support git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@623 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- publish | 20 ++++++++++++++++++-- 1 file 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 -- cgit v1.2.3