Skip to content

Instantly share code, notes, and snippets.

Created July 12, 2011 01:10
Show Gist options
  • Save anonymous/1077168 to your computer and use it in GitHub Desktop.
Save anonymous/1077168 to your computer and use it in GitHub Desktop.
#!/bin/bash
curl http://romshare.deployfu.com/lastupload > /tmp/curupload
diff /tmp/lastupload /tmp/curupload
if [ "$?" = "0" ]
then
echo Already up to date.
exit 0
fi
cp /tmp/curupload /tmp/lastupload
export PATH=/usr/local/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/lib
TMPDIR=/tmp/$1/romshare
mkdir -p $TMPDIR
s3fs s3fs.deployfu.com $TMPDIR -o passwd_file=/home/nginx/.passwd-s3fs
rsync -avz $TMPDIR/slave/romshare /home/nginx
#!/bin/bash
STUFF=$(ps aux | grep s3fswrapper.sh | grep -v grep | wc -l)
if [ "$STUFF" != "2" ]
then
echo $STUFF
echo $STUFF > /home/nginx/romshare.err
exit 0
fi
TMPDIR=/tmp/$$/romshare
umount $TMPDIR
rmdir $TMPDIR
rmdir /tmp/$$
su - nginx -c "/home/nginx/bin/s3fs.sh $$" > /home/nginx/romshare.log
umount $TMPDIR
rmdir $TMPDIR
rmdir /tmp/$$
chown -R nginx:nginx /home/nginx/romshare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment