-
Notifications
You must be signed in to change notification settings - Fork 0
/
flick-update-views.sh
executable file
·33 lines (25 loc) · 1.01 KB
/
flick-update-views.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
ZFILE=00PHTML
DWDSCRIPT=flick-store-views.pl
REPSCRIPT=flick-report-views.pl
GRHSCRIPT=flick-graph-views.pl
GRHFILE=flick-views.png
perl $DWDSCRIPT
## http://steve-parker.org/sh/exitcodes.shtml
if [ "$?" -ne "0" ] ; then echo " *** Problems to store data *** " ; exit 1 ;
else
echo "OK: stored"
fi
perl $REPSCRIPT -zeros -lang=pl > 00-pl.phtml && \
perl $REPSCRIPT -zeros -lang=en > 00-en.phtml && \
perl $REPSCRIPT -max=25 -lags -lang=pl > 25-pl.phtml && \
perl $REPSCRIPT -max=25 -lags -lang=en > 25-en.phtml && \
perl $GRHSCRIPT
if [ "$?" -ne "0" ] ; then echo " *** Problems to produce summaries *** " ; exit 1 ; fi
echo " ** :: OK :: INFORMATION UPDATED :: **"
echo " ** Update remote server:: **"
zip $ZFILE.zip 00*.phtml 25*.phtml flick-views-log.phtml $GRHFILE && \
scp -B $ZFILE.zip [email protected]:Download/$ZFILE.zip && \
ssh [email protected] 'cd Download && unzip -o -d ../public_html/images 00PHTML.zip \
&& cd ../public_html/images && ../../bin/my-patch '
rm -rf $ZFILE.zip