Skip to content

Commit 8fb42af

Browse files
committed
add log in check_download
1 parent 93cf57d commit 8fb42af

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Install/customize_firmware.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,21 @@ check_download() {
105105
local URL=$1
106106
local EXPECTED_HASH=$2
107107
local OUTPUT_FILE=$3
108+
echo >> /root/install_customice.log
109+
echo $URL >> /root/install_customice.log
110+
echo $EXPECTED_HASH >> /root/install_customice.log
111+
echo $OUTPUT_FILE >> /root/install_customice.log
112+
108113

109114
wget --waitretry=10 -t 5 -O "/root/$OUTPUT_FILE" "$URL"
110115

111116
if [[ $? -eq 0 ]]; then
112117
if check_hash "$OUTPUT_FILE"; then
113-
echo "Hash is okay"
118+
echo "Hash is okay" >> /root/install_customice.log
114119
break
115120
else
116121
# echo "Hash-Error"
117-
rm -f "$OUTPUT_FILE"
122+
rm -f "$OUTPUT_FILE" && echo 'del file false Hash' >> /root/install_customice.log
118123
fi
119124
fi
120125
}

customize_firmware.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,21 @@ check_download() {
105105
local URL=$1
106106
local EXPECTED_HASH=$2
107107
local OUTPUT_FILE=$3
108+
echo >> /root/install_customice.log
109+
echo $URL >> /root/install_customice.log
110+
echo $EXPECTED_HASH >> /root/install_customice.log
111+
echo $OUTPUT_FILE >> /root/install_customice.log
112+
108113

109114
wget --waitretry=10 -t 5 -O "/root/$OUTPUT_FILE" "$URL"
110115

111116
if [[ $? -eq 0 ]]; then
112117
if check_hash "$OUTPUT_FILE"; then
113-
echo "Hash is okay"
118+
echo "Hash is okay" >> /root/install_customice.log
114119
break
115120
else
116121
# echo "Hash-Error"
117-
rm -f "$OUTPUT_FILE"
122+
rm -f "$OUTPUT_FILE" && echo 'del file false Hash' >> /root/install_customice.log
118123
fi
119124
fi
120125
}

0 commit comments

Comments
 (0)