#!/bin/sh ########################################################## # SSTV-Copy 0.2 - GPL 2002 by Gerhard Beck (OE/5B4ABX) # # Simple shell-script for autocopy SSTV images received # # by MMSSTV or any other SSTV package +++ # ########################################################## DATE="`date +%d%m%y-%H%M`" DATE2="`date +%V-%Y`" DIR=/var/www/html/SSTV/pics DIRS=/var/www/html/SSTV ARC=/var/www/html/SSTV/archive/$DATE2 LAST=/$DIRS/lastpic.txt PIC1=Hist1.jpg PIC2=Hist2.jpg PIC3=Hist3.jpg PIC4=Hist4.jpg if [ -e $DIR/Hist1.jpg ];then cp $DIR/$PIC1 $ARC/Pic-$DATE-1.jpg cp -f $DIR/$PIC1 $DIRS/Image1.jpg rm -f $DIR/$PIC1 ls -l --full-time $DIRS/Image1.jpg | cut -c 44-68 > $LAST else if [ -e $DIR/Hist2.jpg ];then cp $DIR/$PIC2 $ARC/Pic-$DATE-2.jpg cp -f $DIR/$PIC2 $DIRS/Image2.jpg rm -f $DIR/$PIC2 ls -l --full-time $DIRS/Image2.jpg | cut -c 44-68 > $LAST else if [ -e $DIR/Hist3.jpg ];then cp $DIR/$PIC3 $ARC/Pic-$DATE-3.jpg cp -f $DIR/$PIC3 $DIRS/Image3.jpg rm -f $DIR/$PIC3 ls -l --full-time $DIRS/Image3.jpg | cut -c 44-68 > $LAST else if [ -e $DIR/Hist4.jpg ];then cp $DIR/$PIC4 $ARC/Pic-$DATE-4.jpg cp -f $DIR/$PIC4 $DIRS/Image4.jpg rm -f $DIR/$PIC4 ls -l --full-time $DIRS/Image4.jpg | cut -c 44-68 > $LAST else exit 1 fi fi fi fi