BuildTools 2 years ago
parent
commit
ff2a05e6c3
1 changed files with 10 additions and 0 deletions
  1. 10 0
      desk_check.sh

+ 10 - 0
desk_check.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+__check_desktop() {
+  if [ `(dpkg-query -W -f='${Status}' ubuntu-desktop 2>/dev/null | grep -c "ok installed")` -eq 1 ]; then
+    echo "Ubuntu Server is required, but it appears that you are running Ubuntu Desktop"
+    exit 1
+  fi
+}
+
+# Now just call the function:
+__check_desktop