Thomas Hochstein 9c66269fce addlang.sh: Move input to backup after run.
And check for input file before starting.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2019-08-17 12:59:54 +02:00

23 lines
586 B
Bash
Executable File

#!/bin/bash
if [ "x$1" = "x" ]
then
echo "USAGE: addlang.sh INPUT-FILE"
echo "----------------------------"
echo "This script will append the contents of INPUT-FILE to every "
echo "available language file."
exit 1
else
if [ ! -f $1 ]; then
echo "$1 does not exist."
exit 10;
fi
find . -maxdepth 1 -name \*.inc.php -exec ./append.sh $1 {} \;
TIMESTAMP=$(date +"%Y%m%d%H%M")
mv $1 $1.$TIMESTAMP
cd UTF-8
./recode.sh
echo "-------------------------------------------------"
echo "Please check the result and remove $1.$TIMESTAMP."
fi