• 0 Posts
  • 3 Comments
Joined 1 year ago
cake
Cake day: January 5th, 2024

help-circle


  • Create a systemd user unit that waits for the network-online.target.

    A script something like:

    [Unit]
    Description=Startup script
    Requires=network-online.target
    After=network-online.target
    
    [Service]
    Type=oneshot # either simple or oneshot, but sounds like oneshot
    ExecStart=/home/<user>/script.sh
    RemainAfterExit=yes #if oneshot, otherwise no
    
    [install]
    WantedBy=default.target
    

    Edit the template according to your needs and dump it into ~/.local/share/systemd/user/<unit>.service and enable it with systemctl --user enable --now <unit>