So I want to write a script which shuts down the Ubuntu system when the Lan cable is unplugged.
But my problem is, that I am a complete newbie to this subject!
I have never ever made something with systemd, service-files, startup, etc.
The entire day I am trying it to make it run but the sad fact is, that I always failed.
I would be so thankful if someone could tell how to do it and with some explanations of whats going on in some parts of his/her code!
Thank you very much already!
JTR
Oh! My system is Ubuntu 22.04! 🙂
I actually tried so much already.
My last try was to make run google-chrome at startup, but that was not working either.
My service-file:
[Unit]
Description=thats a script
[Service]
Type=simple
User=oscar
ExecStart=/usr/bin/env google-chrome
[Install]
WantedBy=multi-user.target
My script:
#!/bin/bash
import os
os.system('/usr/bin/googlechrome)
JTR666 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.