#!/bin/sh

cd /home/http-user/flasher-root/temp/nattsjo_solarin/plots

head day.gplot -n 7 >day_solar.gplot
echo "set key right" >>day_solar.gplot
tail -n 4 day.gplot | head -n 3 >>day_solar.gplot
echo "plot '/home/flasher-http/public/temp/nattsjo_solarin/plots/temp_day_nattsjo_solarin.dat' ti 'Solar_in' with lines, '/home/flasher-http/public/temp/nattsjo_solarout/plots/temp_day_nattsjo_solarout.dat' ti 'Solar_out' with lines" >>day_solar.gplot

head week.gplot -n 7 >week_solar.gplot
echo "set key right" >>week_solar.gplot
tail -n 4 week.gplot | head -n 3 >>week_solar.gplot
echo "plot '/home/flasher-http/public/temp/nattsjo_solarin/plots/temp_week_nattsjo_solarin.dat' ti 'Solar_in' with lines, '/home/flasher-http/public/temp/nattsjo_solarout/plots/temp_week_nattsjo_solarout.dat' ti 'Solar_out' with lines" >>week_solar.gplot

head month.gplot -n 7 >month_solar.gplot
echo "set key right" >>month_solar.gplot
tail -n 4 month.gplot | head -n 3 >>month_solar.gplot
echo "plot '/home/flasher-http/public/temp/nattsjo_solarin/plots/temp_month_nattsjo_solarin.dat' ti 'Solar_in' with lines, '/home/flasher-http/public/temp/nattsjo_solarout/plots/temp_month_nattsjo_solarout.dat' ti 'Solar_out' with lines" >>month_solar.gplot

gnuplot day_solar.gplot week_solar.gplot month_solar.gplot


cd /home/flasher-http/public/temp/nattsjo_solarout/plots

head day.gplot -n 7 >day_solar.gplot
echo "set key right" >>day_solar.gplot
tail -n 4 day.gplot | head -n 3 >>day_solar.gplot
echo "plot '/home/flasher-http/public/temp/nattsjo_solarout/plots/temp_day_nattsjo_solarout.dat' ti 'Solar_out' with lines, '/home/flasher-http/public/temp/nattsjo_solarin/plots/temp_day_nattsjo_solarin.dat' ti 'Solar_in' with lines" >>day_solar.gplot

head week.gplot -n 7 >week_solar.gplot
echo "set key right" >>week_solar.gplot
tail -n 4 week.gplot | head -n 3 >>week_solar.gplot
echo "plot '/home/flasher-http/public/temp/nattsjo_solarout/plots/temp_week_nattsjo_solarout.dat' ti 'Solar_out' with lines, '/home/flasher-http/public/temp/nattsjo_solarin/plots/temp_week_nattsjo_solarin.dat' ti 'Solar_in' with lines" >>week_solar.gplot

head month.gplot -n 7 >month_solar.gplot
echo "set key right" >>month_solar.gplot
tail -n 4 month.gplot | head -n 3 >>month_solar.gplot
echo "plot '/home/flasher-http/public/temp/nattsjo_solarout/plots/temp_month_nattsjo_solarout.dat' ti 'Solar_out' with lines, '/home/flasher-http/public/temp/nattsjo_solarin/plots/temp_month_nattsjo_solarin.dat' ti 'Solar_in' with lines" >>month_solar.gplot

gnuplot day_solar.gplot week_solar.gplot month_solar.gplot