Add new comment

Want to support HowtoForge? Become a subscriber!
Submitted by glisha (registered user) on Wed, 2007-04-04 11:57.

Prehaps one could use something like this to check if urchin.js was downloaded successfully and only then update the local version.

#!/bin/sh
WHERE='/home/glisha/js'
wget --quiet -O "$WHERE/urchin_temp.js" http://www.google-analytics.com/urchin.js

if [ "$?" -eq "0" ]; then
    chmod 644 "$WHERE/urchin_temp.js"
    cp "$WHERE/urchin_temp.js" "$WHERE/urchin.js"
fi;
rm "$WHERE/urchin_temp.js"
exit 0;
Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.

Reply

*
*
The content of this field is kept private and will not be shown publicly.


*

  • Images can be added to this post.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <div>
  • Lines and paragraphs break automatically.