From cb6472a9805f36cad8145eea8a01bd9a1d523445 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 24 Apr 2020 20:15:57 +0200 Subject: [PATCH] Clean up bash issues with missing files. --- copy_firefox_data.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/copy_firefox_data.sh b/copy_firefox_data.sh index 52c732b..5207439 100755 --- a/copy_firefox_data.sh +++ b/copy_firefox_data.sh @@ -24,9 +24,9 @@ if [ -x ~/bin/firefox_tabgroups_export.py ]; then do_copy=0 mkdir -p ${backups}/tabs mkdir -p ${backups}/tabs/sessionstore - previous=$( ls ${backups}/tabs/firefox_tabs.* | tail -1 ) + previous=$( ls ${backups}/tabs/firefox_tabs.* 2>/dev/null | tail -1 ) ~/bin/firefox_tabgroups_export.py > ${backups}/tabs/firefox_tabs.${epoch} - if [ -f ${previous} ]; then + if [ -f "${previous}" ]; then if diff -q ${previous} ${backups}/tabs/firefox_tabs.${epoch} >/dev/null; then # No difference, remove this file if [ ${previous} != ${backups}/tabs/firefox_tabs.${epoch} ]; then @@ -56,7 +56,7 @@ if [ -x ~/bin/firefox_decrypt.py ]; then mkdir -p ${backups}/passwords previous=$( ls ${backups}/passwords/firefox_passwords.* | tail -1 ) echo '' | ~/bin/firefox_decrypt.py > ${backups}/passwords/firefox_passwords.${epoch} 2>/dev/null - if [ -f ${previous} ]; then + if [ -f "${previous}" ]; then if diff -q ${previous} ${backups}/passwords/firefox_passwords.${epoch} >/dev/null; then # No difference, remove this file if [ ${previous} != ${backups}/passwords/firefox_passwords.${epoch} ]; then