forked from OctoPrint/CustoPiZer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
install git; remove pioreactorui.log references; new config; new scri…
…pt to publish pioreactor.local on all interfaces
- Loading branch information
1 parent
9c18a0f
commit 805188f
Showing
7 changed files
with
42 additions
and
26 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Retrieve the domain alias from the configuration file | ||
DOMAIN_ALIAS=$(crudini --get /home/pioreactor/.pioreactor/config.ini ui domain_alias) | ||
IP=$(hostname -I | awk '{print $1}') | ||
|
||
while [ "$IP" == "127.0.0.1" ] | ||
do | ||
# Function to publish mDNS for each IP | ||
publish_mdns() { | ||
local ip=$1 | ||
echo "Publishing mDNS for $DOMAIN_ALIAS at IP $ip" | ||
/usr/bin/avahi-publish -a -R "$DOMAIN_ALIAS" "$ip" || true & | ||
} | ||
|
||
# Get all IP addresses, ignoring localhost | ||
while :; do | ||
IP_ADDRESSES=$(hostname -I | tr ' ' '\n' | grep -v '^127\.') | ||
|
||
if [ -n "$IP_ADDRESSES" ]; then | ||
break | ||
fi | ||
|
||
echo "Waiting for a valid network interface..." | ||
sleep 2 | ||
IP=$(hostname -I | awk '{print $1}') | ||
done | ||
|
||
|
||
/usr/bin/avahi-publish -a -R "$DOMAIN_ALIAS" "$IP" || true & | ||
# Iterate over each IP and publish mDNS | ||
for IP in $IP_ADDRESSES; do | ||
publish_mdns "$IP" | ||
done |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
rotate 10 | ||
compress | ||
notifempty | ||
create 0660 pioreactor pioreactor | ||
create 0666 pioreactor pioreactor | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
|
||
export LC_ALL=C | ||
|
||
|
||
source /common.sh | ||
install_cleanup_trap | ||
|
||
sudo apt-get install git -y | ||
|