#!/bin/sh CONF_PATH=.comicinfo FILE=ComicInfo.xml BACKUP=${FILE}_BACKUP LANG=$CONF_PATH/LanguageISO if [ ! -d $CONF_PATH ] then mkdir -p $CONF_PATH ln -sf ../$CONF_PATH/* $CONF_PATH rm -f $CONF_PATH/Number $CONF_PATH/Volume $LANG fi if [ -f $FILE ] then cp $FILE $BACKUP fi if [ -f $LANG ] then echo "(A language code describing the language of the book. Without any information on what kind of code this element is supposed to contain, it is recommended to use the IETF BCP 47 language tag, which can describe the language but also the script used. This helps to differentiate languages with multiple scripts, like Traditional and Simplified Chinese.) :" read VAR echo $VAR > $LANG fi for file in *.cbz; do N=$(echo ${file: -6:2}| sed 's/^0//') && ci@set Number $N && ci@set Volume $N && ci@gen -f && cat $FILE && zip -rv $file $FILE; done rm -f $CONF_PATH/Number $CONF_PATH/Volume $LANG if [ -f $BACKUP ] then mv -f $BACKUP $FILE fi