Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/configure_hostname.sh
ExecStartPost=/bin/systemctl disable --now %n
RemainAfterExit=yes
Restart=on-failure
RestartSec=30s
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/bash

# Get current hostname
CURRENT_HOSTNAME=$(hostname)

# Only proceed if current hostname is "picompose"
if [ "$CURRENT_HOSTNAME" != "picompose" ]; then
echo "Current hostname is $CURRENT_HOSTNAME (not picompose), skipping hostname change"
exit 0
fi

# Get active interface
IFACE=$(ip route | grep default | awk '{print $5}' | head -n 1)

Expand Down
Loading