Skip to content

Commit 4b2e3b3

Browse files
authored
Merge pull request #28 from mglae/fix_updown
2 parents 3454b44 + cde22cb commit 4b2e3b3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

configuration/startup-shutdown.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The `autostart.sh` script runs at the start of userspace boot. It can be used to
88
nano /storage/.config/autostart.sh
99
```
1010

11-
You can place any commands in the script, but note they will block the boot process until they complete, and the network stack will not be up when the script runs, so most uses of `autostart.sh` require you to "background" and delay the commands, e.g. the following script sleeps for 20 seconds and then runs a `kodi-send` command to update the video library.
11+
You can place any commands in the script, but note they will block the boot process until they complete, so most uses of `autostart.sh` require you to "background" and delay the commands, e.g. the following script sleeps for 20 seconds and then runs a `kodi-send` command to update the video library.
1212

1313
```text
1414
(
@@ -17,6 +17,8 @@ You can place any commands in the script, but note they will block the boot proc
1717
)&
1818
```
1919

20+
The network stack will be up when the script runs.
21+
2022
## autostop.sh
2123

2224
The `autostop.sh` script runs during the shutdown process, but before the network is shutdown. It does not exist by default, but you can create it using nano.
@@ -27,6 +29,8 @@ nano /storage/.config/autostop.sh
2729

2830
Like the `autostart.sh` script you can place any commands in the script, and they will block the shutdown process for up to 5 minutes and then will be terminated automatically.
2931

32+
`autostop.sh` is avalable as of LibreELEC 10.0.2 or LibreELEC 11 nightlies 2022-02-04.
33+
3034
## shutdown.sh
3135

3236
The `shutdown.sh` script run during the shutdown process. It does not exist by default, but you can create it using nano.
@@ -35,7 +39,7 @@ The `shutdown.sh` script run during the shutdown process. It does not exist by d
3539
nano /storage/.config/shutdown.sh
3640
```
3741

38-
Unlike the `autostart.sh` script, the `shutdown.sh` script should follow the following template to ensure commands are executed during the correct event, i.e. you can run different commands for a `reboot` event to `halt` event, or use the `*` as a catch-all.
42+
Unlike the `autostart.sh` script the network stack will not be up when the script runs and the `shutdown.sh` script should follow the following template to ensure commands are executed during the correct event, i.e. you can run different commands for a `reboot` event to `halt` event, or put commands outside the `case ... esac` as a catch-all.
3943

4044
```text
4145
case "$1" in
@@ -48,9 +52,7 @@ case "$1" in
4852
reboot)
4953
# your commands here
5054
;;
51-
*)
52-
# your commands here
53-
;;
5455
esac
56+
# your commands here
5557
```
5658

0 commit comments

Comments
 (0)