summaryrefslogtreecommitdiff
path: root/preseed/fetch-example.sh
blob: fa89bdbaa46bcaf37bb9c9350f38e67e51398158 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

if [ -z "$1" ] && [ -z "$2" ]; then
  echo "Usage: $0 <distro> <codename>"
  exit 1
fi

distro="$1"
codename="$2"

case "$distro" in
  debian)
     wget "https://www.debian.org/releases/$codename/example-preseed.txt" -O "$codename-example.cfg"
     ;;
  ubuntu)
     rel="$codename"
     case "$codename" in
       xenial)
         rel="16.04"
         ;;
       bionic)
         rel="18.04"
         ;;
     esac
     wget "https://help.ubuntu.com/$rel/installation-guide/example-preseed.txt" -O "$codename-example.cfg"
     ;;
esac

exit 0