Browse Source

Fix wrong codename definition for ubuntu/debian.

Raphael Schneeberger 7 years ago
parent
commit
5935b24711
1 changed files with 9 additions and 1 deletions
  1. 9 1
      install/hst-migration.sh

+ 9 - 1
install/hst-migration.sh

@@ -11,7 +11,6 @@
 
 HESTIA="/usr/local/hestia"
 os=$(head -n1 /etc/issue | cut -f 1 -d ' ')
-codename=$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))
 apt="/etc/apt/sources.list.d"
 
 # Am I root?
@@ -33,6 +32,15 @@ if [ "$type" = "NoSupport" ]; then
     exit 1;
 fi
 
+# Detect Codename
+if [ "$type" = "debian" ]; then
+    codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
+fi
+
+if [ "$type" = "ubuntu" ]; then
+    codename="$(lsb_release -s -c)"
+fi
+
 # Check if Vesta is installed
 if [ -f /usr/local/vesta/conf/vesta.conf ]; then
     source /usr/local/vesta/conf/vesta.conf