1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/bin/bash
- if ! [ -f /etc/rc.local ]
- then
- cat <<'EOF'>>/tmp/rc.local
- #!/bin/bash
- 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
|