summaryrefslogtreecommitdiff
path: root/al32-mktorrent.sh
diff options
context:
space:
mode:
authorSimon Doppler <dopsi@dopsi.ch>2017-08-06 20:51:08 +0200
committerSimon Doppler <dopsi@dopsi.ch>2017-08-06 20:51:40 +0200
commit4d238ce495f298921b086fc76dfde9465fc1bb8d (patch)
treef323ac6a8ee3d6e61fc30f2827bb1e39857fe5cb /al32-mktorrent.sh
parenteeb3193ff0e16fb989e0c2d8d5912010f4c4eddb (diff)
downloadreleng-4d238ce495f298921b086fc76dfde9465fc1bb8d.tar.xz
Improve options handling
Diffstat (limited to 'al32-mktorrent.sh')
-rw-r--r--al32-mktorrent.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/al32-mktorrent.sh b/al32-mktorrent.sh
index 6843a9a..1103364 100644
--- a/al32-mktorrent.sh
+++ b/al32-mktorrent.sh
@@ -28,17 +28,20 @@ fg_bold="\033[1m"
MIRRORLIST_FILE="https://raw.githubusercontent.com/archlinux32/packages/master/core/pacman-mirrorlist/mirrorlist"
-mirrorlist="$(curl "$MIRRORLIST_FILE" 2>/dev/null | grep Server | cut -d '=' -f 2 | sed -e 's/\s//g;s_$arch/$repo_archisos/_')"
-
declare -a available_mirrors
iso_date=''
-while getopts "u:p:t:f:d:" o; do
+while getopts "d:h" o; do
case "${o}" in
d)
iso_date=${OPTARG}
;;
+ h)
+ usage
+ exit
+ ;;
*)
+ echo "$0: unknown option ${o}" >&2
usage
;;
esac
@@ -47,6 +50,8 @@ shift $((OPTIND-1))
[ -z "$iso_date" ] && read -r -p "Date of the ISO: " iso_date
+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'"
arch="i686"