Index: /tags/ipp-20130307/pstamp/scripts/pstamp_save_server_status.pl
===================================================================
--- /tags/ipp-20130307/pstamp/scripts/pstamp_save_server_status.pl	(revision 35570)
+++ /tags/ipp-20130307/pstamp/scripts/pstamp_save_server_status.pl	(revision 35571)
@@ -12,17 +12,11 @@
 use Pod::Usage qw( pod2usage );
 
-# XXX: We should get this from site.config, but that would about double
-# the execution time for this script.
-# my $rundir = "/data/ippc17.0/pstamp";
-my $rundir = "/data/ippc30.1/pstamp";
-
-my $status_file = "$rundir/web/status.html";
-
 my $updatelink;
 my $verbose;
 my $save_temps;
+my $pstamp_workdir;
 
 GetOptions(
-    'rundir=s'      => \$rundir,
+    'workdir=s'      => \$pstamp_workdir,
     'update-link'    => \$updatelink,
     'verbose'       => \$verbose,
@@ -38,9 +32,20 @@
 }
 
+if (!$pstamp_workdir) {
+    my $ipprc = PS::IPP::Config->new(); # IPP Configuration
+    $pstamp_workdir = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_WORKDIR');
+}
+
+if (!$pstamp_workdir) {
+    warn("Failed to find PSTAMP_WORKDIR in the config\n");
+    exit($PS_EXIT_CONFIG_ERROR);
+}
+my $status_file = "$pstamp_workdir/server_status/status.html";
+
 my ($sec, $min, $hour, $mday, $month, $year) = gmtime;
 $year += 1900;
 $month += 1;
 
-my $dir = sprintf "$rundir/work/server_status/%4d/%02d/%02d", $year, $month, $mday;
+my $dir = sprintf "$pstamp_workdir/server_status/%4d/%02d/%02d", $year, $month, $mday;
 
 if (!-e $dir ) {
