-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathexec.post
47 lines (34 loc) · 1013 Bytes
/
exec.post
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
#!/bin/bash
# exec.post
# KD4Z
# Version: 4.44
# Runs after glv is completed
userfile=~/user.bin
usertmp=~/header.tmp
cd ~/md380tools-vm
# addstatic script returns user.bin merged as $userfile
./addstatic
if [ -f filter.sys ] && [ ! -f ~/filter.sys.disable ]; then
./filter.sys $userfile
fi
if [ -f ~/md380tools/db/special.tmp ]; then
if [ ! -d ~/cache ]; then
mkdir ~/cache
fi
cp ~/md380tools/db/special.tmp ~/cache
fi
# local hook if desired for extra post processing
# header record not present at this point
if [ -f ~/exec.post.local ]; then
echo -e "${YELLOW}Executing ~/exec.post.local${NC}"
chmod +x ~/exec.post.local
~/exec.post.local $userfile
fi
userbinsize=$(ls -l $userfile | cut -d" " -f5)
echo -e "${GREEN} User.bin filesize : ${YELLOW}${userbinsize} bytes ${GREEN}(not including header record) ${NC}"
# now put back the header
wc -c < $userfile >$usertmp
cat $userfile >>$usertmp
cat $usertmp >$userfile
rm $usertmp
echo -e "${WHITE}Processing complete.${NC}"