modelLine=$(hostnamectl | grep 'Model' | awk '{printf $3}')
model=$(hostnamectl | grep 'Model' | awk '{printf $4}')
-case $vendor in
- "Lenovo") vendorShort="l";;
- "Dell") vendorShort="d";;
- *) hName="immudex";;
-esac
+if [ "$vendor" ] && [ "$modelLine" ] && [ "$model" ]; then
-case $modelLine in
- "ThinkPad") mLShort="TP";;
- "Latitude") mLShort="Lat";;
- *) hName="immudex";;
-esac
+ case $vendor in
+ "Lenovo") vendorShort="l";;
+ "Dell") vendorShort="d";;
+ "Acer") vendorShort="a";;
+ "ASUSTeK") vendorShort="as";;
+ "GOOGLE") vendorShort="go";;
+ "QEMU") vendorShort="kvm";;
+ *) hName="immudex";;
+ esac
+ case $modelLine in
+ "ThinkPad") mLShort="TP";;
+ "Latitude") mLShort="Lat";;
+ "AOD260") mLShort="ao";
+ model="D260";;
+ "Candy") vendorShort="d";
+ mLShort="chrbook";
+ model="3120";;
+ "Inspiron") mLShort="Ins";;
+ "Standard") if [ $vendorShort = "kvm" ]; then
+ mLShort=$(hostnamectl | grep 'Machine ID' | awk '{print $3}' | cut -c 26-33);
+ model="";
+ else
+ mlShort="Std";
+ fi;;
+ *) hName="immudex";;
+ esac
+else
+ if hostnamectl | grep -q 'kvm'; then
+ vendorShort="kvm";
+ mLShort=$(hostnamectl | grep 'Machine ID' | awk '{print $3}' | cut -c 26-33);
+ model="";
+ fi
+fi
if [ ! "$hName" ]; then
hName="${vendorShort}-${mLShort}-$model"
sudo hostnamectl set-hostname $hName;