-
-
Save CamDavidsonPilon/fbf23fea3b5fc199e5c0d4f3aab79c74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
set -e | |
export LC_ALL=C | |
# List of systemd files | |
systemd_files=("/lib/systemd/system/avahi_aliases.service" "/lib/systemd/system/load_rp2040.service") | |
# Loop through each file and add 'User=pioreactor' and 'EnvironmentFile=/etc/environment' under '[Service]' if they don't already exist | |
for file in "${systemd_files[@]}"; do | |
crudini --ini-options=nospace --set "$file" Service User pioreactor | |
crudini --ini-options=nospace --set "$file" Service EnvironmentFile "/etc/environment" | |
done | |
systemctl daemon-reload | |
systemctl restart avahi_aliases.service | |
systemctl restart load_rp2040.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment