#!/bin/csh -f # album # ----------------------------------------------------------------------------- # Shell script to view picture album or slideshow for this folder of pics. # ----------------------------------------------------------------------------- set option_slideshow = "false" if ($#argv > 0 && "$1" == "-s") then set option_slideshow = "true" shift endif # Minor hack to make the URL display in its shorter form. if ("${TRIDENT}" == "trident.bristle.com") then setenv TRIDENT bristle.com endif # Modeled after the remotepub script. See notes there for why pwd -P is used. set local_url = "." set local_dir = "`pwd -P | normalize_filename`" # If I'm in a /Users/fred/Pictures/Pictures folder locally, map # /Users/fred/Pictures/Pictures to the /Pictures URL at the web server. set remote_url = "`echo $local_dir | sed -e 's*/Users/fred/Pictures/Pictures*http://${TRIDENT}/Pictures*'`" # Otherwise, if I'm in a /Users/fred/fred/bristle folder locally, map # /Users/fred/fred/bristle to the URL for the root of web server. set remote_url = "`echo $remote_url | sed -e 's*/Users/fred/fred/bristle*http://${TRIDENT}*'`" # Otherwise, if I'm in a /Users/fred/fred/website/bristle folder locally, map # /Users/fred/fred/website/bristle to the URL for the root of web server. set remote_url = "`echo $remote_url | sed -e 's*/Users/fred/fred/website/bristle*http://${TRIDENT}*'`" if ("$option_slideshow" == "true") then set local_url = "$local_url/slideshow" set remote_url = "$remote_url/slideshow" endif set local_url = "$local_url/index.htm" # Default to "any" instead of "o" so debugwebsite chooses the default. set browser = "any" if ($#argv > 0) then set browser = $1:q shift endif set url = $remote_url if ("$1" == "remote") then set url = $remote_url:q shift else if ("$1" == "local" || "$1" == "-l") then set url = $local_url:q shift endif if ("$url" == "$local_url") then if (! -e $url) then echo "Local URL $url not found. Aborting..." exit 1 endif endif debugwebsite $browser:q $url:q