Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # In case the dhcp server is not capable of assigning a dnsdomainname, hostname -f fails.
- # Fallback to IP of host.
- diff --git a/dist/obsapisetup b/dist/obsapisetup
- index 678dc64..d428ef5 100755
- --- a/dist/obsapisetup
- +++ b/dist/obsapisetup
- @@ -30,6 +30,14 @@ webuidir=/srv/www/obs/webui
- FQHOSTNAME=`hostname -f`
- +if [ "$?" != "0" ]; then
- + # Fallback to IP of the VM/host
- + FQHOSTNAME=`ip addr | sed -n 's,.*inet \(.*\)/.* brd.*,\1,p' | grep -v ^127. | head -n 1`
- + if [ "$?" != "0" ]; then
- + echo " Can't determine hostname or IP - Network setup failed!"
- + echo " Check if networking is up and dhcp is working!"
- + fi
- +fi
- . /etc/sysconfig/obs-server
- if [ "$OBS_API_AUTOSETUP" != "yes" ]; then
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement