Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
welcome:ubuntu:small_tricks [2022/11/26 20:07] arnaud [Run a script at startup] |
welcome:ubuntu:small_tricks [2023/01/08 15:11] (Version actuelle) arnaud [Attendre la fin du script] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
<color # | <color # | ||
+ | ====== Add a network interface (Ubuntu22) by CLI ====== | ||
+ | * list the interfaces < | ||
+ | * activate the interface < | ||
+ | * set the IP of the interface: < | ||
+ | * apply the settings:< | ||
====== Auto-connect VPN and Wifi ====== | ====== Auto-connect VPN and Wifi ====== | ||
< | < | ||
Ligne 17: | Ligne 22: | ||
[SeatDefaults] | [SeatDefaults] | ||
session-setup-script=/ | session-setup-script=/ | ||
+ | |||
+ | ====== Beep ====== | ||
+ | Pour activer le " | ||
+ | * < | ||
+ | * tester si le beep fonctionne: < | ||
+ | $ beep</ | ||
+ | * Rendre persistant: < | ||
+ | ....</ | ||
Ligne 49: | Ligne 62: | ||
#!/bin/bash | #!/bin/bash | ||
- | / | + | / |
< | < | ||
$ sudo cat / | $ sudo cat / | ||
Ligne 64: | Ligne 77: | ||
< | < | ||
# chmod 664 / | # chmod 664 / | ||
- | </ | + | </code> |
+ | <code> | ||
# systemctl enable wol-omv.service</ | # systemctl enable wol-omv.service</ | ||
+ | |||
+ | ===== Attendre la fin du script ===== | ||
+ | <note important> | ||
+ | https:// | ||
+ | https:// | ||
+ | https:// | ||
+ | |||
+ | < | ||
+ | $ sudo cat / | ||
+ | [Unit] | ||
+ | After=network-online.target | ||
+ | Wants=network-online.target | ||
+ | |||
+ | [Service] | ||
+ | Type=oneshot | ||
+ | TimeoutStartSec=10s | ||
+ | ExecStart=/ | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=default.target | ||
</ | </ | ||
+ | Il faut un " | ||
====== Terminal ====== | ====== Terminal ====== |