Skip to content

Commit 0bf7e0b

Browse files
author
KyuHyuk Lee
committed
PiCLFS for Raspberry Pi 4
0 parents  commit 0bf7e0b

34 files changed

+1993
-0
lines changed

01-download-packages.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
#
3+
# PiCLFS packages download script
4+
# Optional parameteres below:
5+
export WORKSPACE_DIR=$PWD
6+
export SOURCES_DIR=$WORKSPACE_DIR/sources
7+
# End of optional parameters
8+
9+
function success() {
10+
echo -e "\e[1m\e[32m$1\e[0m"
11+
}
12+
13+
function timer {
14+
if [[ $# -eq 0 ]]; then
15+
echo $(date '+%s')
16+
else
17+
local stime=$1
18+
etime=$(date '+%s')
19+
if [[ -z "$stime" ]]; then stime=$etime; fi
20+
dt=$((etime - stime))
21+
ds=$((dt % 60))
22+
dm=$(((dt / 60) % 60))
23+
dh=$((dt / 3600))
24+
printf '%02d:%02d:%02d' $dh $dm $ds
25+
fi
26+
}
27+
28+
total_download_time=$(timer)
29+
30+
wget -c -i $WORKSPACE_DIR/wget-list -P $SOURCES_DIR
31+
32+
success "\nTotal download time: $(timer $total_download_time)\n"

0 commit comments

Comments
 (0)