Skip to content

Commit

Permalink
Simplified after review and fixed order
Browse files Browse the repository at this point in the history
  • Loading branch information
to-bar committed Oct 7, 2019
1 parent d0117e1 commit 585cb1e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -eu

yum-config-manager --disable epirepo
yum clean all --enablerepo=epirepo --disablerepo='*'
yum clean all --disablerepo='*' --enablerepo=epirepo
yum repolist
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ create_directory() {
fi
}

# params: <seconds>
display_seconds() {
local seconds=$1
local h=$((seconds/3600))
local m=$((seconds%3600/60))
local s=$((seconds%60))
(( h > 0 )) && printf '%dh ' $h
(( m > 0 )) && printf '%dm ' $m
printf '%ds' $s
}

# params: <file_url> <dest_dir>
download_file() {
local file_url="$1"
Expand Down Expand Up @@ -590,4 +579,4 @@ remove_installed_packages "$INSTALLED_PACKAGES_FILE_PATH"

readonly END_TIME=$(date +%s)

echol "$(basename $0) finished, execution time: $(display_seconds $((END_TIME-START_TIME)))"
echol "$(basename $0) finished, execution time: $(date -u -d @$((END_TIME-START_TIME)) +'%T')"
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ create_directory() {
fi
}

# params: <seconds>
display_seconds() {
local seconds=$1
local h=$((seconds/3600))
local m=$((seconds%3600/60))
local s=$((seconds%60))
(( h > 0 )) && printf '%dh ' $h
(( m > 0 )) && printf '%dm ' $m
printf '%ds' $s
}

# params: <file_url> <dest_dir>
download_file() {
local file_url="$1"
Expand Down Expand Up @@ -613,4 +602,4 @@ remove_installed_packages "$INSTALLED_PACKAGES_FILE_PATH"

readonly END_TIME=$(date +%s)

echol "$(basename $0) finished, execution time: $(display_seconds $((END_TIME-START_TIME)))"
echol "$(basename $0) finished, execution time: $(date -u -d @$((END_TIME-START_TIME)) +'%T')"

0 comments on commit 585cb1e

Please sign in to comment.