Permalink
Browse files

fix to dining menu file permissions problem [#563]

  • Loading branch information...
1 parent eda507a commit 98a4ca15f9995a6e72a278c7d1ac15c3b8655666 David Ormsbee committed Nov 17, 2010
Showing with 8 additions and 4 deletions.
  1. +8 −4 mobi-scripts/reload-dining.sh
@@ -2,7 +2,11 @@
# Crontab entry: 15 06 * * 0 /opt/mitmobile/bin/reload-dining.sh
-# The sudo is here so that people running this script as "sudo ./reload-dining.sh"
-# don't accidentally make the file owned by root (breaking future attempts to
-# copy by apache).
-sudo -u apache cp /home/huds/upload/menu.csv /opt/mitmobile/static/menu.csv
+cp /home/huds/upload/menu.csv /opt/mitmobile/static/menu.csv
+
+# This is supposed to be run by user apache, but it might be run by someone
+# doing sudo ./reload-dining.sh --> so make sure we set the permissions properly
+# in that case.
+
+chown apache /opt/mitmobile/static/menu.csv
+chgrp apache /opt/mitmobile/static/menu.csv

0 comments on commit 98a4ca1

Please sign in to comment.