update-ifo.sh
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 25 Sep 2010 21:04:09 +0300
changeset 166 ec6cc02decdc
parent 4 746384ca83b6
permissions -rwxr-xr-x
Typo fixes.

#!/bin/sh

help() {
  echo "Usage:"
  echo "  update-ifo.sh <file>.ifo"
}

if [ x$1 = x ]; then
  help
  exit 1
fi

name=$1
name=${name%.ifo}
echo $1
echo $name

if [ $1 = $name ]; then
  echo "Error: file must have .ifo extension."
  exit 1
fi

if [ ! -e $1 ]; then
  echo "Error: file $1 not exist."
fi

date=`date +%Y-%m-%d`

echo "author=Oleksandr Gavenko" >>$1
echo "email=gavenkoa@gmail.com" >>$1
echo "website=http://gavenkoa.blogspot.com" >>$1
echo "date=$date" >>$1
if [ -e $name.descr ]; then
  echo "description="`head -n 1 $name.descr` >>$1
fi