|
@@ -0,0 +1,41 @@
|
|
|
+
|
|
|
+if ! [ -f /etc/rc.local ]
|
|
|
+then
|
|
|
+cat <<'EOF'>>/tmp/rc.local
|
|
|
+
|
|
|
+exit 0
|
|
|
+EOF
|
|
|
+sudo cp /tmp/rc.local /etc/
|
|
|
+sudo chmod +x /etc/rc.local
|
|
|
+sudo systemctl disable rc-local
|
|
|
+sudo systemctl disable rc.local
|
|
|
+fi
|
|
|
+
|
|
|
+if ! [ -f /lib/systemd/system/rc-local.service ]
|
|
|
+then
|
|
|
+cat <<'EOF'>> /tmp/rc-local.service
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+[Unit]
|
|
|
+Description=/etc/rc.local Compatibility
|
|
|
+ConditionFileIsExecutable=/etc/rc.local
|
|
|
+After=network.target
|
|
|
+
|
|
|
+[Service]
|
|
|
+Type=forking
|
|
|
+ExecStart=/etc/rc.local start
|
|
|
+TimeoutSec=0
|
|
|
+RemainAfterExit=yes
|
|
|
+GuessMainPID=no
|
|
|
+EOF
|
|
|
+
|
|
|
+sudo cp /tmp/rc-local.service /lib/systemd/system/rc-local.service
|
|
|
+sudo systemctl daemon-reload
|
|
|
+fi
|