Retrieve automaticaly lastest debian version
This commit is contained in:
parent
8a62ce69df
commit
bc433889b4
1 changed files with 14 additions and 3 deletions
17
init.sh
17
init.sh
|
@ -9,7 +9,9 @@ OPTIND=1
|
|||
|
||||
# Default Variables
|
||||
debian_arch="amd64"
|
||||
debian_version="8.7.1"
|
||||
debian_version=$(wget -q --output-document - https://cdimage.debian.org/debian-cd/ | \
|
||||
grep -o '[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0.9]\{1,2\}' | head -1)
|
||||
archive=0
|
||||
boot_type="efi64"
|
||||
repo_dir="repo"
|
||||
tmp_dir="tmp"
|
||||
|
@ -71,7 +73,11 @@ process_args() {
|
|||
fi
|
||||
;;
|
||||
--debian-version)
|
||||
debian_version=$2
|
||||
if [[ $debian_version != $2 ]]
|
||||
then
|
||||
archive=1
|
||||
debian_version=$2
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
--repo)
|
||||
|
@ -214,7 +220,12 @@ then
|
|||
fi
|
||||
|
||||
bootfiles_Debian="http://ftp.debian.org/debian/dists/jessie/main/installer-${debian_arch}/current/images/hd-media"
|
||||
iso_url="http://cdimage.debian.org/debian-cd/${debian_version}/${debian_arch}/iso-cd"
|
||||
if [ $archive ]
|
||||
then
|
||||
iso_url="http://cdimage.debian.org/cdimage/archive/${debian_version}/${debian_arch}/iso-cd"
|
||||
else
|
||||
iso_url="http://cdimage.debian.org/debian-cd/${debian_version}/${debian_arch}/iso-cd"
|
||||
fi
|
||||
iso_file="debian-${debian_version}-${debian_arch}-netinst.iso"
|
||||
repo_path="$repo_dir/$debian_arch/$debian_version"
|
||||
|
||||
|
|
Reference in a new issue