File tree Expand file tree Collapse file tree 1 file changed +46
-14
lines changed Expand file tree Collapse file tree 1 file changed +46
-14
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
4
+
5
+ exists ()
6
+ {
7
+ if command -v $1 & > /dev/null
8
+ then
9
+ # echo " Yes, command :$1: was found."
10
+ return 0
11
+ else
12
+ # echo " No, command :$1: was NOT found."
13
+ return 1
14
+ fi
15
+ }
16
+
17
+ killadbserver (){
18
+
19
+ echo " Adb found, killing the adb server"
20
+ adb kill-server
21
+
22
+ echo
23
+ echo " *******************************************************"
24
+ echo " Please unplug and replug any currently connected devices"
25
+ echo " Press enter to continue"
26
+ read pause
27
+
28
+ echo " "
29
+ echo " *******************************************************"
30
+
31
+ adb devices
32
+
33
+
34
+ }
35
+
36
+
4
37
echo " "
5
38
echo " *******************************************************"
6
39
echo " Add device permisions to the udev rules by LinuxMotion"
12
45
echo " Restarting udev to read the new rules"
13
46
sudo service udev restart
14
47
15
- echo
16
- echo " Killing the adb server"
17
48
18
- adb kill-server
49
+ else
19
50
20
- echo
21
- echo " *******************************************************"
22
- echo " Please unplug and replug any currently connected devices"
23
- echo " Press enter to continue"
24
- read pause
51
+ echo " Your files was not created, please run again with sudo"
25
52
26
- echo " "
27
- echo " *******************************************************"
53
+ fi
28
54
29
- adb devices
55
+ adbexists=& (exists adb)
56
+ echo $x
30
57
31
- else
58
+ if [ $adbexists -eq0 ]
59
+ then
60
+
61
+ killadbserver
62
+
63
+ else
64
+ echo " ADB is not in your path, but the script was created"
65
+ fi
32
66
33
- echo " Your files was not created, please run again with sudo"
34
- fi
35
67
You can’t perform that action at this time.
0 commit comments