Created
July 12, 2011 01:10
-
-
Save anonymous/1077168 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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