version 1.3.2.21, 2017/10/09 22:12:45
|
version 1.3.2.22, 2017/10/09 23:48:00
|
Line 24 cd ${2:-/etc}
|
Line 24 cd ${2:-/etc}
|
|
|
case "$1" in |
case "$1" in |
load) |
load) |
CFG_NAND_MAP=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $3); }'` | CFG_NAND_MAP=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $3); }'` |
CFG_NAND_SIZE=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $2 * 512); }'` | CFG_NAND_SIZE=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $2 * 512); }'` |
|
|
imgupd -gs ${CFG_NAND_SIZE} -f ${CFG_NAND_MAP} | \ |
imgupd -gs ${CFG_NAND_SIZE} -f ${CFG_NAND_MAP} | \ |
gunzip 2>&- | cpio -iud 2>&- || die "ERROR:: config load" |
gunzip 2>&- | cpio -iud 2>&- || die "ERROR:: config load" |
;; |
;; |
save) |
save) |
CFG_NAND_MAP=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $3); }'` | CFG_NAND_MAP=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $3); }'` |
CFG_NAND_SIZE=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $2 * 512); }'` | CFG_NAND_SIZE=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $2 * 512); }'` |
|
|
if [ ! -r ${CFG_NAND_LIST} ]; then |
if [ ! -r ${CFG_NAND_LIST} ]; then |
echo "# Auto generated manifest file" >${CFG_NAND_LIST} |
echo "# Auto generated manifest file" >${CFG_NAND_LIST} |
Line 47 case "$1" in
|
Line 47 case "$1" in
|
imgupd -is ${CFG_NAND_SIZE} -f ${CFG_NAND_MAP} || die "ERROR:: config save" |
imgupd -is ${CFG_NAND_SIZE} -f ${CFG_NAND_MAP} || die "ERROR:: config save" |
;; |
;; |
erase) |
erase) |
CFG_NAND_MAP=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $3); }'` | CFG_NAND_MAP=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $3); }'` |
CFG_NAND_SIZE=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $2 * 512); }'` | CFG_NAND_SIZE=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $2 * 512); }'` |
|
|
imgupd -is ${CFG_NAND_SIZE} -f ${CFG_NAND_MAP} /dev/zero || die "ERROR:: config erase" |
imgupd -is ${CFG_NAND_SIZE} -f ${CFG_NAND_MAP} /dev/zero || die "ERROR:: config erase" |
echo "Config NAND was erased!" |
echo "Config NAND was erased!" |
;; |
;; |
restore) |
restore) |
CFG_NAND_MAP=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $3); }'` | CFG_NAND_MAP=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $3); }'` |
CFG_NAND_SIZE=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $2 * 512); }'` | CFG_NAND_SIZE=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $2 * 512); }'` |
|
|
ELWIX_REMOTE_HOST=`cat /etc/myelwix` |
ELWIX_REMOTE_HOST=`cat /etc/myelwix` |
ping -c1 $(echo ${ELWIX_REMOTE_HOST} | cut -f3 -d '/' | cut -f2 -d '@') >/dev/null 2>&1 |
ping -c1 $(echo ${ELWIX_REMOTE_HOST} | cut -f3 -d '/' | cut -f2 -d '@') >/dev/null 2>&1 |
Line 71 case "$1" in
|
Line 71 case "$1" in
|
echo "ELWIX restore process complete. Now rebooting system ..." |
echo "ELWIX restore process complete. Now rebooting system ..." |
;; |
;; |
backup) |
backup) |
CFG_NAND_MAP=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $3); }'` | CFG_NAND_MAP=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $3); }'` |
CFG_NAND_SIZE=`gpart show -p | awk '($3 ~ "d[0-9]g" && $4 == "\!0") { printf("%s\n", $2 * 512); }'` | CFG_NAND_SIZE=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"g") { printf("%s", $2 * 512); }'` |
|
|
ELWIX_REMOTE_HOST="/tmp/${ELWIX_CFG_BACKUP_NAME}" |
ELWIX_REMOTE_HOST="/tmp/${ELWIX_CFG_BACKUP_NAME}" |
|
|