-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhimawari-rx__sataid.sh
180 lines (126 loc) · 4.21 KB
/
himawari-rx__sataid.sh
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/bin/bash
echo "'-----------------------------------------------------------'"
echo "' himawari-rx__sataid.sh '"
echo "'This is the sataid script(start by decode script automatic)'"
echo "' '"
echo "' @tcjj3 github.com/tcjj3/himawari-rx_auto_scripts '"
echo "'-----------------------------------------------------------'"
BASEDIR=$(dirname $0)
cd $BASEDIR
tmp_path="/tmp"
#tmp_path="/dev/shm"
Proc_File() {
BASEDIR=$(dirname $0)
DirPath="$1/$2"
FileName="$3"
FileName="${FileName: 0: 24}"
FilePath="$DirPath/$FileName"
wine $BASEDIR/hrit2sataid/hritconcat.exe -d1="$FilePath"_001 -d2="$FilePath"_002 -d3="$FilePath"_003 -d4="$FilePath"_004 -d5="$FilePath"_005 -d6="$FilePath"_006 -d7="$FilePath"_007 -d8="$FilePath"_008 -d9="$FilePath"_009 -d10="$FilePath"_010 -o=$FilePath.hrit -p > /dev/null
wine $BASEDIR/hrit2sataid/hrit2sataid.exe -z $FilePath.hrit $FilePath.Z$2 $BASEDIR/hrit2sataid/hrit2sataid_FullDisk.ini > /dev/null
mv $FilePath.Z$2 $1/SATAID/$FileName.Z$2 > /dev/null
}
folder_path="$1"
DirName="$2"
DirPath="$folder_path/$DirName"
if [ -z "$folder_path" ]; then
echo "This script can't run directly!"
echo "Exit..."
exit 0
fi
mkdir "$folder_path/SATAID" > /dev/null
firstLine=1
for k in $DirPath/IMG_DK01B04_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01B05_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01B06_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01B07_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01B09_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01B10_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01B11_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01B12_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01B14_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01B16_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01IR1_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01IR2_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01IR3_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01IR4_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
firstLine=1
for k in $DirPath/IMG_DK01VIS_*; do
FileName=`echo $k | awk -F '/' '{print $NF}'`
[ "$firstLine" == "1" ] && Proc_File "$folder_path" "$DirName" "$FileName"
firstLine=0
done
if [ -f "$BASEDIR/himawari-rx__rmdir.sh" ]; then
$BASEDIR/himawari-rx__rmdir.sh "$DirPath" &
[ ! -z "$DirPath" ] && rm -r "$DirPath" > /dev/null &
else
touch "$DirPath/decoded.txt"
fi