File: host64.sh

package info (click to toggle)
open-plc-utils 0.0.6%2Bgit20250712.46c3506-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,208 kB
  • sloc: ansic: 60,860; xml: 16,179; sh: 1,216; makefile: 698
file content (53 lines) | stat: -rwxr-xr-x 1,627 bytes parent folder | download | duplicates (3)
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/sh
# file: scripts/host.sh

# edit a PIB file then kick off the INT6300 Host Emulator; if you do
# not want to edit the PIB file before starting then comment out the
# line that does that;

# ====================================================================
# host symbols;
# --------------------------------------------------------------------

. ${SCRIPTS}/hardware.sh
. ${SCRIPTS}/firmware.sh

# ====================================================================
# file symbols;
# --------------------------------------------------------------------

MAC=auto
DAK=$(rkey secret.key -D)
NMK=$(rkey secret.key -M)

# ====================================================================
# confirm MAC;
# --------------------------------------------------------------------

echo -n "MAC Address [${MAC}]: "; read
if [ ! -z ${REPLY} ]; then
	MAC="${REPLY}"                  
fi

# ====================================================================
# modify PIB;
# --------------------------------------------------------------------

modpib ${PIB} -C0 -M ${MAC} -N ${NMK} -D ${DAK}
if [ ${?} != 0 ]; then
	exit 1
fi

# ====================================================================
# service host action request messages;
# --------------------------------------------------------------------

# Force Flash NVRAM 
# int64host -i ${ETH} -P ${PIB} -N ${NVM} -p abc.pib -n abc.nvm -FF
# Flash NVRAM (continuous loop because FW/PIB sent to host) 
# int64host -i ${ETH} -P ${PIB} -N ${NVM} -p abc.pib -n abc.nvm -F
int64host -i ${ETH} -P ${PIB} -N ${NVM} -p abc.pib -n abc.nvm
if [ ${?} != 0 ]; then
	exit 1
fi