Skip to content

Instantly share code, notes, and snippets.

@MACscr
Created December 6, 2016 06:44
Show Gist options
  • Save MACscr/09a2228a82f5dddf680c1fc960e0b68d to your computer and use it in GitHub Desktop.
Save MACscr/09a2228a82f5dddf680c1fc960e0b68d to your computer and use it in GitHub Desktop.
#!/bin/bash
working_dir="/var/www/media/podcasts/"
file1="feed.xml.attempt"
file2="feed.xml"
generator="feed.php"
cd "$working_dir"
php "$generator" > "$file1"
if [ ! -s "$file2" ]
then
mv "$file1" "$file2"
else
echo "$file1"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment