Просмотр исходного кода

Fix issue with rc.local not being executable

Kristan Kenney 6 лет назад
Родитель
Сommit
541ff07600
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      install/hst-install-ubuntu.sh

+ 6 - 0
install/hst-install-ubuntu.sh

@@ -1623,6 +1623,12 @@ if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
     if [ -e /etc/rc.local ]; then
         sed -i '/exit 0/d' /etc/rc.local
     fi
+
+    check_rclocal=$(cat /etc/rc.local | grep "#!")
+    if [ -z "$check_rclocal" ]; then
+        echo "#!/bin/sh" >> /etc/rc.local
+    fi
+
     echo "$HESTIA/bin/v-update-sys-ip" >> /etc/rc.local
     echo "exit 0" >> /etc/rc.local
     chmod +x /etc/rc.local