Skip to content
Snippets Groups Projects
Commit 611db589 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Do not add skyreach repository if no API key is set.

parent 3db4751a
No related branches found
No related tags found
No related merge requests found
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
source /root/envsetup/conf.sh source /root/envsetup/conf.sh
# Download config file from skyreach # Download config file from skyreach
conf_url="https://$SKYREACH_HOST/erp/credentials/$SKYREACH_API_KEY/conf.sh" if ( ! test -z ${SKYREACH_API_KEY} ); then
if ( curl -I "$conf_url" >/dev/null ); then conf_url="https://$SKYREACH_HOST/erp/credentials/$SKYREACH_API_KEY/conf.sh"
wget -q "$conf_url" -O /root/envsetup/conf.sh if ( curl -I "$conf_url" >/dev/null ); then
source /root/envsetup/conf.sh wget -q "$conf_url" -O /root/envsetup/conf.sh
else source /root/envsetup/conf.sh
echo "Failed to download configuration using url:" else
echo " $conf_url" echo "Failed to download configuration using url:"
echo " $conf_url"
fi
fi fi
# Autogenerate missing values # Autogenerate missing values
......
...@@ -22,16 +22,20 @@ apt-get install -y aptitude apt-transport-https ...@@ -22,16 +22,20 @@ apt-get install -y aptitude apt-transport-https
#apt-get dist-upgrade -y #apt-get dist-upgrade -y
# modify sources.list to use ubicast cache # modify sources.list to use ubicast cache
if ( ! grep "${APT_CACHE_HOST}" /etc/apt/sources.list >/dev/null ); then if ( ! test -z ${APT_CACHE_HOST} ); then
echo "Updating sources.list to use cache ${APT_CACHE_HOST}." if ( ! grep "${APT_CACHE_HOST}" /etc/apt/sources.list >/dev/null ); then
sed -i "s@http://@http://${APT_CACHE_HOST}/@" /etc/apt/sources.list echo "Updating sources.list to use cache ${APT_CACHE_HOST}."
sed -i "s@http://@http://${APT_CACHE_HOST}/@" /etc/apt/sources.list
fi
fi fi
# APT panel # APT panel
echo "Adding skyreach.list to APT sources." if ( ! test -z ${SKYREACH_API_KEY} ); then
wget -q "https://${SKYREACH_HOST}/media/public.gpg" -O- | sudo apt-key add - echo "Adding skyreach.list to APT sources."
echo "deb https://${SKYREACH_HOST} packaging/apt/${SKYREACH_API_KEY}/" > /etc/apt/sources.list.d/skyreach.list wget -q "https://${SKYREACH_HOST}/media/public.gpg" -O- | sudo apt-key add -
apt-get update echo "deb https://${SKYREACH_HOST} packaging/apt/${SKYREACH_API_KEY}/" > /etc/apt/sources.list.d/skyreach.list
apt-get update
fi
# unattended-upgrades # unattended-upgrades
echo "Installing and configuring unattended-upgrades." echo "Installing and configuring unattended-upgrades."
......
...@@ -12,7 +12,7 @@ NC='\033[0m' ...@@ -12,7 +12,7 @@ NC='\033[0m'
# -- System -- # -- System --
# Skyreach in which system looks for packages # Skyreach in which system looks for packages
SKYREACH_HOST='panel.ubicast.eu' SKYREACH_HOST='panel.ubicast.eu'
SKYREACH_API_KEY='sde6b2af8d9feb2153d82e8183aa26a5' SKYREACH_API_KEY=
# NTP # NTP
NTP_SERVER1='ntp.ubuntu.com' NTP_SERVER1='ntp.ubuntu.com'
NTP_SERVER2= NTP_SERVER2=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment