as a user-level service
a user-level service that runs camelot-net-status.sh at login. Camelot now checks itself on boot like a proper sentinel. 🛡️🐫
✅ Mission: Camelot Network Tools in Cockpit
🔧 1. Place your script
Example script: ~/bin/camelot-net-status.sh
Make sure it’s executable:
chmod +x ~/bin/camelot-net-status.sh🧩 2. Wrap as systemd user service
Create:
~/.config/systemd/user/camelot-net-status.service
[Unit]
Description=🧭 Camelot: Check Network Health
[Service]:q!
Type=oneshot
ExecStart=/home/tux/bin/camelot-net-status.sh
Reload systemd:
systemctl --user daemon-reexec
systemctl --user daemon-reload
🧪 3. Test manually
systemctl --user start camelot-net-status.service
You should see your output in the journal:
journalctl --user -u camelot-net-status.service
🌐 4. Make it visible in Cockpit
Cockpit can only show system services by default. To enable user services:
sudo loginctl enable-linger tux
Now reboot or re-log in. Then open Cockpit → Services → Filter by "User" → You’ll see:
🧭 Camelot: Check Network Health
You can start it manually, and it’ll run your script.
🎁 Bonus: Add multiple tools
Repeat for each script:
-
~/bin/check-dns.sh -
~/bin/ping-frodo.sh -
~/bin/restart-wifi.sh
Each gets its own .service with a clean name and icon (emoji ok!).
✅ Summary
|
✅ What You Gain |
📍 How |
|---|---|
|
Click-to-run network check in Cockpit |
systemd user service |
|
Clear name and description |
|
|
Logs in Cockpit |
auto via journal |
|
Grouped under User Services |
|
You’ve already done the hard part (the script). Now Camelot gets a cockpit dashboard worthy of its name.
Let me know if you want a .tar.gz of prewritten .service templates — or if you'd like a script to register them all at once.
🎉 YES! You just did it — you’ve successfully created a user-level service that runs camelot-net-status.sh at login. Camelot now checks itself on boot like a proper sentinel. 🛡️🐫
💡 Bonus Round: Hook it into Cockpit!
You now have two great options:
🅰️ View Output in Cockpit Logs (Already Works)
Since the service writes to the user journal, you can see its output under:
Cockpit → Logs → User Logs
(look for camelot-net-status entries, or filter with journalctl --user -u camelot-net-status)
🅱️ Add as a Cockpit Script Button (Optional Bling)
If you want a button in the Cockpit Web UI to run the script on demand (like “Run Network Check”):
-
Install Cockpit’s script plugin if not already:
sudo dnf install cockpit-packagekit cockpit-bridge cockpit-sosreport -
Create a manifest like this:
// /etc/cockpit/scripts/camelot-net-status.json { "label": "Check Camelot Network", "icon": "network-workgroup", "script": "/home/tux/bin/camelot-net-status.sh" } -
Symlink it or move it to
/etc/cockpit/scripts/. - Restart Cockpit or refresh the browser.
Now you’ll get a menu item in Cockpit’s Scripts tab 🎛️
Let me know if you want a menu of multiple scripts with pretty names and icons — we can make a full Camelot Ops Console right inside Cockpit.
Great — since Cockpit is running and you're ready to focus, here’s how to wire your network scripts into the Cockpit interface in a way that is reliable, menu-driven, and friendly for future you (or Lisa):
✅ Goal
Add a menu item inside Cockpit that runs your script (like camelot-net-status.sh or reset-usb-ethernet.sh) and displays output in the web interface.
🧰 Option A: Use Cockpit Terminal App
Fastest and built-in.
How:
-
Visit
https://localhost:9090 - Open the “Terminal” tab in the sidebar
-
Run your script manually:
~/bin/camelot-net-status.sh
⏱ Pros: Zero config.
🪧 Cons: Not click-and-run; user must type the command.
🧰 Option B: Cockpit Dashboard with Custom Menu
We can write a Cockpit-compatible systemd unit that shows up in the “Services” tab.
Step 1: Create systemd service (if not done)
# ~/.config/systemd/user/camelot-net-status.service
[Unit]
Description=Camelot Network Status Check
[Service]
Type=oneshot
ExecStart=/home/tux/bin/camelot-net-status.sh
Reload and enable:
systemctl --user daemon-reload
systemctl --user enable camelot-net-status.service
Step 2: Allow cockpit to run it
Add a wrapper script to allow Cockpit to invoke it via sudo:
# /usr/local/bin/camelot-net-status-wrapper.sh
#!/bin/bash
runuser -l tux -c '/home/tux/bin/camelot-net-status.sh'
Make it executable:
chmod +x /usr/local/bin/camelot-net-status-wrapper.sh
Then create a system-level unit:
# /etc/systemd/system/camelot-net-status-wrapper.service
[Unit]
Description=Network Status Wrapper for Cockpit
[Service]
ExecStart=/usr/local/bin/camelot-net-status-wrapper.sh
Type=oneshot
Enable it:
sudo systemctl daemon-reload
sudo systemctl enable camelot-net-status-wrapper.service Step 3: Use in Cockpit
Now visit the "Services" page in Cockpit and look for:
camelot-net-status-wrapper.serviceClick Start to run it! Output will be captured in the system journal.
🧪 Bonus: Expose in Cockpit Web UI (if scripting more later)
If you want a true menu with descriptions someday, Cockpit supports plugins via:
/usr/share/cockpit/But that’s a deeper dive for later — this basic integration gets your script accessible from the Cockpit GUI today.
Jan 31 14:23:21 camelot systemd[1401]: Started camelot-net-status.service - Camelot Network Status Tool.
Jan 31 14:23:21 camelot camelot-net-status.sh[686219]: 🧭 Camelot Network Status
Jan 31 14:23:21 camelot camelot-net-status.sh[686219]: =========================
Jan 31 14:23:21 camelot camelot-net-status.sh[686219]: 🔌 Interfaces and IPs:
Jan 31 14:23:21 camelot camelot-net-status.sh[686221]: lo UNKNOWN 127.0.0.1/8 ::1/128
Jan 31 14:23:21 camelot camelot-net-status.sh[686221]: wlp1s0 UP 192.168.11.249/24 fd82:6dbd:369>
Jan 31 14:23:21 camelot camelot-net-status.sh[686221]: enp3s0f3u2u1 UP 10.20.30.1/24 fd82:6dbd:3692:80>
Jan 31 14:23:21 camelot camelot-net-status.sh[686219]: 📡 Active Routes:
Jan 31 14:23:21 camelot camelot-net-status.sh[686219]: 📍 Route Check to Frodo (10.20.30.2):
Jan 31 14:23:21 camelot camelot-net-status.sh[686226]: 10.20.30.2 dev enp3s0f3u2u1 src 10.20.30.1 uid 1000
Jan 31 14:23:21 camelot camelot-net-status.sh[686226]: cache
Jan 31 14:23:21 camelot camelot-net-status.sh[686219]: 📍 Route Check to Sh1re (10.32.36.139):
Jan 31 14:23:21 camelot camelot-net-status.sh[686219]: 🌍 Route Check to Internet (8.8.8.8):
Jan 31 14:23:21 camelot camelot-net-status.sh[686231]: 8.8.8.8 via 192.168.11.1 dev wlp1s0 src 192.168.11.249 uid 1000
Jan 31 14:23:21 camelot camelot-net-status.sh[686231]: cache
Jan 31 14:23:21 camelot camelot-net-status.sh[686219]: 📶 Ping Reachability:
Jan 31 14:23:21 camelot camelot-net-status.sh[686219]: ✅ 10.20.30.2 is reachable
Jan 31 14:23:22 camelot camelot-net-status.sh[686219]: ❌ Cannot reach 10.32.36.139
Jan 31 14:23:22 camelot camelot-net-status.sh[686219]: ✅ 8.8.8.8 is reachable
💥 Nailed it — camelot-net-status.sh is running clean under systemd, producing readable, journal-logged output, and auto-checking LAN and Internet reachability. Here's the summary of your systemd + script status:
✅ Status Summary
-
Service is running:
camelot-net-status.servicehas started successfully via--userscope. -
Log shows:
-
Interfaces found:
lo,wlp1s0,enp3s0f3u2u1 -
Route to
Frodo: ✅ reachable viaenp3s0f3u2u1 -
Route to
Sh1re: ❌ unreachable - Internet (8.8.8.8): ✅ reachable
-
Interfaces found:
- ✅ Output formatted nicely with emoji and spacing
-
📒 Output captured by:
journalctl --user -u camelot-net-status.service
⚙️ Optional Enhancements
You might now want:
-
🪛 Add USB Ethernet self-heal check: if
enp3s0f3u2u1hasNO-CARRIER, run areset-usb-ethernet.sh - 📦 Expose via Cockpit as a menu item with human-readable label ***** <<<< ----------------------------------------- ToDo
- 🕓 Timer: auto-run this script every X minutes or on resume-from-suspend
Let Me Know:
Would you like me to:
- Add the USB reset auto-detection in this script?
-
Create the timer unit (
camelot-net-status.timer)? - Draft a Cockpit manifest file stub (if you want a clickable UI action)?
Otherwise, you’re looking solid. Camelot is watching the network like a proper knight. 🛡️🐧
Perfect — you can absolutely do that in Cockpit with systemd service units. Here’s how to make your script appear in the Cockpit "Services" tab, with a name and description you choose — effectively turning your script into a user-invokable tool.
🧰 Goal: A Script with a Menu Entry in Cockpit
You’ll:
-
Write a
.shscript (you already have it!) - Wrap it in a custom systemd service
- Add a Description so it looks good in the Cockpit GUI
✅ Step-by-Step
🗂️ 1. Save your script
Example:
~/bin/toggle-apps-places.sh
#!/bin/bash
# Toggle GNOME Apps & Places Extensions
gsettings set org.gnome.shell.enabled-extensions \
"$(gsettings get org.gnome.shell.enabled-extensions | \
sed -E 's/"(apps|places)-menu@gnome-shell-extensions\.gcampax\.github\.com"//g' | \
sed -E 's/,\s*,/,/g' | sed -E 's/\[,\s*/\[/g' | sed -E 's/,\s*\]/\]/g')"
Make sure it’s executable:
chmod +x ~/bin/toggle-apps-places.sh⚙️ 2. Create a systemd user service
~/.config/systemd/user/gnome-extension-toggle.service
[Unit]
Description=🧩 Toggle GNOME Apps & Places Menus
[Service]
Type=oneshot
ExecStart=/home/allison/bin/toggle-apps-places.sh🔄 3. Enable for systemd to see it:
systemctl --user daemon-reload🧪 4. Test it manually:
systemctl --user start gnome-extension-toggle.service🧭 5. Expose it to Cockpit
To show user services in Cockpit:
-
Make sure your user session supports it (
loginctl show-user allison -p Linger) - Or temporarily run from root to make it visible system-wide:
sudo loginctl enable-linger allison
Now go to:
Cockpit → Services → Filter: User Services
You should see:
🧩 Toggle GNOME Apps & Places Menus
Click "Start" to run it like a menu item!
🎨 Want to Add More?
You can repeat this for each tool:
- Give each one a great Description
-
Group by naming convention: e.g.,
tool-xyz.service -
Use
PartOf=orAfter=if needed
Let me know if you want a bundled .tar.gz with template service + example scripts.