-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.run
executable file
·54 lines (44 loc) · 1.29 KB
/
installer.run
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
#!/bin/bash
#(1)
echo 'Killing lap_monitord and childs..'
sudo kill -$(pidof lap_monitord)
sleep 1
#(2)
sudo \cp -p etc/rc.local /etc/
sudo chmod u+x /etc/rc.local
#(3)
sudo \cp -a home/user/. /home/pi/
sudo chmod u+x /home/pi/flush_logs.run /home/pi/lapst01.restart /home/pi/libmodbusexport.sh
sudo chmod u+x /home/pi/ppp0default.sh /home/pi/test2.sh /home/pi/lapst01.run /home/pi/ppp-creator.sh
sudo chmod u+x /home/pi/rtcsync.sh /home/pi/modem_reload.sh /home/pi/network_priority.sh /home/pi/test1.sh
#(4)
cd home
sudo \cp alarm_check_reg_list.txt slave_reg_list.txt /home/
cd ../
BIN="src/" # lap_bin/src
PATH_STATIC="dist/Debug/GNU-Linux"
cd $BIN
#(5)
#copy all files of src
FPATH="./*/$PATH_STATIC/*" # "./*/dist/Debug/GNU-Linux/*"
for file in $FPATH;
do
filename="${file##*/}"
basn=$(basename $(dirname $(dirname $(dirname $(dirname $file))) ))
#echo "basename $basn"
sudo chmod u+x $file
sudo yes | cp -i -p $file ../../NetBeansProjects/$basn/dist/Debug/GNU-Linux/
#sudo cp -p $file ../../NetBeansProjects/$basn/dist/Debug/GNU-Linux/
#echo "hello $file $basn"
done
echo "Successfull copy..."
#(6)
sudo reboot
exit;
#(1) stop all process
#(2) copy rc.local, this file will launch all process after reboot
#(3) copy ohter files
#(4) copy reg_list
#(5) copy source
#(6) reboot device
#(7)