Browse code

check.sh & youtube-dl.sh now Shellcheck approved

dewomser authored on19/02/2019 17:24:57
Showing1 changed files
... ...
@@ -1,19 +1,19 @@
1 1
 #!/bin/bash
2
-if which firefox >/dev/null; then
3
-    firefox=1
2
+if command -v firefox >/dev/null; then
3
+   firefox=1
4 4
 else
5 5
     firefox=0
6 6
 fi
7 7
 
8 8
 
9
-if which youtube-dl >/dev/null; then
9
+if command -v youtube-dl >/dev/null; then
10 10
     youtube_dl=1
11 11
 else
12 12
     youtube_dl=0
13 13
 fi
14 14
 
15 15
 
16
-if which sqlite3 >/dev/null; then
16
+if command -v sqlite3 >/dev/null; then
17 17
     sqlite3=1
18 18
 else
19 19
     sqlite3=0
Browse code

check dependencies +

dewomser authored on01/11/2018 01:51:47
Showing1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,63 @@
1
+#!/bin/bash
2
+if which firefox >/dev/null; then
3
+    firefox=1
4
+else
5
+    firefox=0
6
+fi
7
+
8
+
9
+if which youtube-dl >/dev/null; then
10
+    youtube_dl=1
11
+else
12
+    youtube_dl=0
13
+fi
14
+
15
+
16
+if which sqlite3 >/dev/null; then
17
+    sqlite3=1
18
+else
19
+    sqlite3=0
20
+fi
21
+
22
+
23
+if [ $youtube_dl == 1 ]
24
+then
25
+echo 'youtube-dl is installed'
26
+echo '# Array function is available'
27
+
28
+else
29
+echo '# this script needs youtube-dl'
30
+echo 'sudo apt-get install youtube-dl'
31
+exit
32
+fi
33
+
34
+if [ $firefox == 0 ]
35
+then
36
+echo '# Database function is not available'
37
+echo 'sudo apt-get install firefox'
38
+else
39
+echo 'firefox is installed'
40
+fi
41
+if [ $sqlite3 == 0 ]
42
+then
43
+echo '# Database function is not available'
44
+echo 'sudo apt-get install sqlite3'
45
+else
46
+echo 'sqlite3 is installed'
47
+fi
48
+
49
+if [ $youtube_dl == 1 ] && [ $firefox == 1 ] && [ $sqlite3 == 1 ]
50
+then
51
+echo '# database function is availabe'
52
+echo '# Youtube Channels,Playlists Links must be stored in a bookmark folder. Variable is fav_dir'
53
+else
54
+echo '# database function needs youtube-dl + firefox + sqlite3'
55
+fi
56
+echo '# make download folder' 
57
+echo 'mkdir ~/Downloads/youtube-dl'
58
+echo '# Open youtube-dl.sh with texteditor and config !'
59
+
60
+
61
+
62
+
63
+