summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2019-11-16 18:17:42 +0100
committerDennis Eriksen <d@ennis.no>2019-11-16 18:17:42 +0100
commitaf4d5b02f81151d1373d64ca574ec4bff95a332c (patch)
treeb7830ff52cce8c2296fd71fd4465dc600ee4d02b
parentadding updates- and security-repositories (diff)
downloadmkosi-cgit-af4d5b02f81151d1373d64ca574ec4bff95a332c.tar.gz
lsb_release is not always installed - using grep and awk instead
-rwxr-xr-xmkosi.postinst5
1 files changed, 3 insertions, 2 deletions
diff --git a/mkosi.postinst b/mkosi.postinst
index 69f53e3..2b348aa 100755
--- a/mkosi.postinst
+++ b/mkosi.postinst
@@ -8,8 +8,9 @@ systemctl mask motd-news.service
systemctl mask motd-news.timer
# Add update- and security-repositories, and perform upgrade
-echo "deb http://no.archive.ubuntu.com $(lsb_release --short --codename)-security main universe" >> /etc/apt/sources.list
-echo "deb http://no.archive.ubuntu.com $(lsb_release --short --codename)-updates main universe" >> /etc/apt/sources.list
+RELEASE=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F'=' '{print $2}')
+echo "deb http://no.archive.ubuntu.com ${RELEASE}-security main universe" >> /etc/apt/sources.list
+echo "deb http://no.archive.ubuntu.com ${RELEASE}-updates main universe" >> /etc/apt/sources.list
apt update && apt --yes full-upgrade && apt --yes autoremove
# cgit