I'm trying to write a script to:
1 - download several mp3's
2 - if they downloaded, rename the files
3 - if they didn't download...exit script
4 - if they did download, scp them to another server (I haven't written this part yet...wanted to get the first part working first.)
Here's what I have so far:
Code:
#!/bin/sh
set -e
cd /var/www/testing/
wget -nd -r -l1 --no-parent --no-passive-ftp -A.mp3 'ftp://username:password@IP'
if [ -e /var/www/testing/MIXWX.mp3.1 ];
then
echo `rm Mix\ 2p.mp3`
echo `cp MIXWX.mp3.1 Mix\ 2p.mp3`
echo `rm MIXWX.mp3`
echo `rm MIXWX.mp3.1`
else
echo ``
if [ -e /var/www/testing/REALWX.mp3.1 ];
then
echo `rm Real\ 2p.mp3`
echo `cp REALWX.mp3.1 Real\ 2p.mp3`
echo `rm REALWX.mp3`
echo `rm REALWX.mp3.1`
else
echo ``
if [ -e /var/www/testing/TALKWX.mp3.1 ];
then
echo `rm Talk\ 2p.mp3`
echo `cp TALKWX.mp3.1 Talk\ 2p.mp3`
echo `rm TALKWX.mp3`
echo `rm TALKWX.mp3.1`
else
echo ``
if [ -e /var/www/testing/WMIS.mp3.1 ];
then
echo `rm Talk\ 2p.mp3`
echo `cp WMIS.mp3.1 WMIS\ 2p.mp3`
echo `rm WMIS.mp3`
echo `rm WMIS.mp3.1`
else
echo ``
if [ -e /var/www/testing/Current.mp3 ];
then
echo `rm Current.mp3`
else
echo ``
exit
I'm getting this error:
Quote:
|
Line 56: syntax error: unexpected end of file
|
Any ideas what I'm doing wrong?
Thanks!
Recent comments
22 hours 11 min ago
22 hours 16 min ago
1 day 3 hours ago
1 day 9 hours ago
1 day 10 hours ago
1 day 11 hours ago
1 day 16 hours ago
1 day 22 hours ago
2 days 2 hours ago
2 days 4 hours ago