Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions thunderbird-patch
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,20 @@ fi

echo Thunderbird dir is: $THUNDERBIRDDIR

echo checking if $THUNDERBIRDDIR/thunderbird is running ...
pgrep thunderbird -la|grep $THUNDERBIRDDIR/thunderbird;
if [ $? -eq 0 ]; then
echo 'thunderbird is still running!'
exit 1
fi

realomnipath=$THUNDERBIRDDIR/omni.ja

OMNITMPDIR=/tmp/omni
BACKUP_OMNI=thunderbird-omni.ja.backup-$(date +%Y-%m-%d_%H:%m:%S).ja

# if needed BACKUP_OMNI=$THUNDERBIRDDIR/mailer-omni-backup.ja
BACKUP_OMNI=$HOME/mailer-omni-backup-$(date +%Y-%m-%d).ja
U=${SUDO_USER:-$USER}
HOMEDIR=/home/$U

echo "Making directory $OMNITMPDIR ..."
mkdir $OMNITMPDIR
Expand Down Expand Up @@ -78,11 +86,12 @@ echo "Repackaging ..."

# repackage omni.ja: - if startup is slow remove the 9 compression and replace it with 0
zip -qr9XD /tmp/newomni.ja *

echo "Backing up original to $BACKUP_OMNI"
cp $THUNDERBIRDDIR/omni.ja $BACKUP_OMNI
echo "Backing up original $THUNDERBIRDDIR/omni.ja to $HOMEDIR/$BACKUP_OMNI"
cp -v $THUNDERBIRDDIR/omni.ja $HOMEDIR/$BACKUP_OMNI

echo "Trying to copy /tmp/newomni.ja to $realomnipath"
echo "If this doesn't work, try sudo cp /tmp/newomni.ja $realomnipath"
echo
cp /tmp/newomni.ja $realomnipath && echo "Copied new omni.ja into $realomnipath"
cp -iv /tmp/newomni.ja $realomnipath

echo 'done!'