summaryrefslogtreecommitdiff
path: root/scripts/vyos/apt-repo-debian.sh
blob: be360fbddf3c405dedfe2836963254fe92634a2d (plain)
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
30
31
32
33
#!/bin/bash

set -e
set -x

if [[ "${CLOUD_INIT}" != "debian" ]]; then
    echo "$0 - info: cloud_init not debian, skipping"
    exit 0
fi

# set debian list according VYOS_VERSION_MAIN
if [[ "$VYOS_RELEASE" == "equuleus" ]]; then
    debian_list_url="http://${PACKER_HTTP_IP}:${PACKER_HTTP_PORT}/debian_11.list"
elif [[ "$VYOS_RELEASE" == "current" || "$VYOS_RELEASE" == "sagitta" || "$VYOS_RELEASE" == "circinus" ]]; then
    debian_list_url="http://${PACKER_HTTP_IP}:${PACKER_HTTP_PORT}/debian_12.list"
else
    echo "vyos version unsupported, get github repo, fork and send a pull request"
    exit 1
fi

tmp_file=$(mktemp)

wget -O "$tmp_file" "$debian_list_url" || { echo "cant download debian.list from packer http repo"; exit 1; }

mv "$tmp_file" /etc/apt/sources.list.d/debian.list

apt update


#sudo bash -c 'echo "deb http://deb.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list.d/debian.list'
#sudo bash -c 'echo "deb-src http://deb.debian.org/debian buster main contrib non-free" >> /etc/apt/sources.list.d/debian.list'
#sudo bash -c 'echo "deb http://security.debian.org/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list.d/debian.list'
#sudo bash -c 'echo "deb-src http://security.debian.org/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list.d/debian.list'