-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfindSoftPackage
74 lines (61 loc) · 1.61 KB
/
findSoftPackage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
USE_PROCD=1
STOP=01
uPath="/mnt/exUDISK/"
installPath="/usr/bin/share/"
start_service() {
if [ ! -d ${installPath} ]; then
mkdir ${installPath}
fi
while (true)
do
if [ -d $uPath ]; then
packagePath=`find ${uPath} -iname *.ipkf`
if [ -z ${packagePath} ]; then
echo "package path is null"
else
echo "package path is ${packagePath}"
mv ${packagePath} ${installPath}
cd ${installPath}
realPackagePath=`find -iname *.ipkf`
realPath=${realPackagePath%%f*}
echo ${realPath}
mv ${realPackagePath} ${realPath}
chmod +x ${realPath}
opkg --nodeps install ${realPath}
rm ${realPath}
reboot
fi
fi
sleep 10
done
}
reload_service() {
if [ ! -d ${installPath} ]; then
mkdir ${installPath}
fi
while (true)
do
if [ -d $uPath ]; then
packagePath=`find ${uPath} -iname *.ipkf`
if [ -z ${packagePath} ]; then
echo "package path is null"
else
echo "package path is ${packagePath}"
mv ${packagePath} ${installPath}
cd ${installPath}
realPackagePath=`find -iname *.ipkf`
realPath=${realPackagePath%%f*}
echo ${realPath}
mv ${realPackagePath} ${realPath}
chmod +x ${realPath}
opkg --nodeps install ${realPath}
rm ${realPath}
reboot
fi
fi
sleep 10
done
}