Browse code

Exception if we cannot find other then 1 Firefox profile

dewomser authored on02/05/2020 08:46:12
Showing1 changed files

... ...
@@ -37,15 +37,34 @@ $yot_dl_p -U
37 37
 
38 38
 
39 39
 ## Start ##
40
-# there should only be one default , if not change cd #
41
-cd ~/.mozilla/firefox/*default* || exit
40
+
41
+if [ $loadfrom == database ]
42
+then
43
+cd ~/.mozilla/firefox || exit
44
+#find ./ -maxdepth 1 -name "*default*" -type d
45
+ffdefault=$(find ./ -maxdepth 1 -name "*default*" -type d | wc -l)
46
+if [ "$ffdefault" -gt 1 ]
47
+then
48
+echo "There is more then 1 default Firefox profile ! You have to choose one at ~/.mozilla/firefox and edit this script for your need"
49
+find ./ -maxdepth 1 -name "*default*" -type d 
50
+exit
51
+elif [ "$ffdefault" == 0 ]
52
+then
53
+echo " There is no Firefox profile in your ~/.mozilla/firefox but it should. Script can't continue !"
54
+exit
55
+fi
56
+
57
+# If more then 1 FF profile  Edit here ! 
58
+# change *default*  to your profile. Example fdgsfdgfs43543.default.fdsgf 
59
+cd ./*default* || exit
60
+
42 61
 # you cannot read from a running sqlite, but to copy is allowed#
43
-if [ $ffon == 1 ] && [ $loadfrom == database ]
62
+if [ $ffon == 1 ]
44 63
 then
45 64
 cp $sqltdata places2.sqlite
46 65
 sqltdata=places2.sqlite
47 66
 fi
48
-
67
+fi
49 68
 ## only edit dbarray test-content if you want to use it
50 69
 
51 70
 if [ $loadfrom == array ]
... ...
@@ -61,9 +80,9 @@ then
61 80
  
62 81
 else
63 82
  ## This line puts FF bookmarks from sqlite3 to an array ##
64
-
83
+#oldschool#
65 84
 #dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
66
-
85
+#new V.bash4.0#
67 86
 readarray -t dbarray < <(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))')
68 87
 fi
69 88
 cd  $dl_folder || exit
... ...
@@ -76,5 +95,4 @@ $yot_dl_p $aria2 --download-archive $dl_folder/archive/archive-$zaehl.txt --date
76 95
 # echo $i
77 96
 done
78 97
 
79
-## -----------push notification is now an extra script ----+##
80 98