aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Doppler <dopsi@dopsi.ch>2018-05-03 13:39:46 +0200
committerSimon Doppler <dopsi@dopsi.ch>2018-05-03 13:39:46 +0200
commit27187cc9cab7808cbd01bcf308ccca50acca1454 (patch)
treecc9e7e77136f039d9a32d2c32681dcea9ae087bf
parentc3add10fe87cc2a2a33de3bbf5f5eafc4ef7a8f4 (diff)
downloadal32-torrent-27187cc9cab7808cbd01bcf308ccca50acca1454.tar.gz
al32-torrent-27187cc9cab7808cbd01bcf308ccca50acca1454.tar.xz
al32-torrent-27187cc9cab7808cbd01bcf308ccca50acca1454.zip
Run shellcheck
-rw-r--r--al32-mktorrent.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/al32-mktorrent.sh b/al32-mktorrent.sh
index 3049514..b855ea2 100644
--- a/al32-mktorrent.sh
+++ b/al32-mktorrent.sh
@@ -20,11 +20,11 @@ usage () {
echo "Usage: $0 [-d date] [-w webdir] [-t hefurdir] [arch...]"
}
-fg_green="\033[32m"
-fg_red="\033[31m"
-fg_blue="\033[34m"
-fg_reset="\033[0m"
-fg_bold="\033[1m"
+fg_green="\\033[32m"
+fg_red="\\033[31m"
+fg_blue="\\033[34m"
+fg_reset="\\033[0m"
+fg_bold="\\033[1m"
MIRRORLIST_FILE="https://raw.githubusercontent.com/archlinux32/packages/master/core/pacman-mirrorlist/mirrorlist"
@@ -35,7 +35,7 @@ function cleanup () {
function create_torrent_for_arch () {
declare -a available_mirrors
- mirrorlist="$(curl "$MIRRORLIST_FILE" 2>/dev/null | grep Server | cut -d '=' -f 2 | sed -e 's/\s//g;s_$arch/$repo_archisos/_')"
+ mirrorlist="$(curl "$MIRRORLIST_FILE" 2>/dev/null | grep Server | cut -d '=' -f 2 | sed -e "s/\\s//g;s_\$arch/\$repo_archisos/_")"
if [ "$#" -eq 0 ] ; then
echo "No architecture specified, selecting 'i686'"
@@ -56,7 +56,7 @@ function create_torrent_for_arch () {
curl -g "$i" 2>/dev/null | grep -q "$iso_string" && (
echo -e "$fg_reset${fg_green}OK$fg_reset"
) || ( echo -e "$fg_reset${fg_red}Failed$fg_reset" ; false ) || continue
- available_mirrors=(${available_mirrors[@]} "$i")
+ available_mirrors=("${available_mirrors[@]}" "$i")
done
echo "${#available_mirrors[@]} mirrors available"
@@ -104,7 +104,7 @@ function upload_file_to_remote_dir {
### Check for if required programs are present
-which mktorrent 2>&1 >/dev/null || (
+which mktorrent >/dev/null 2>&1 || (
echo "Missing mktorrent"
exit 1
)
@@ -114,7 +114,7 @@ python -c "import feedgenerator" 2>/dev/null || (
exit 1
)
-which transmission-show 2>&1 >/dev/null || (
+which transmission-show >/dev/null 2>&1 || (
echo "Missing transmission-show"
exit 1
)
@@ -150,7 +150,7 @@ done
shift $((OPTIND-1))
if [ "$#" -gt 0 ] ; then
- architectures=($@)
+ architectures=("$@")
fi
[ -z "$iso_date" ] && read -r -p "Date of the ISO: " iso_date