You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running /lib/Froxlor/Cli/InstallCommand.php i'm getting an error with hostname -I not being a valid command
System information
Froxlor version: 2.0.10
Web server: apache2
DNS server: Bind
POP/IMAP server: Dovecot
SMTP server: postfix
FTP server: proftpd
OS/Version: Gentoo 17.1 (OpenRC)
To Reproduce php ./bin/froxlor-cli froxlor:install
Logfiles
hostname: invalid option -- 'I'
Additional context
hostname utility is part of sys-apps/net-tools package on Gentoo.
All linux distro don't have the -I option for hostname.
I suggest the following one liner which will give you similar results, the output is one ip per line, so you shouldn't need to do an explode as it should directly be an array ip addr show | awk '/inet / {split($2, a, "/"); if (a[1] != "127.0.0.1") print a[1]}'
if you want it to have the same output as you already have : ip addr show | awk '/inet / {split($2, a, "/"); if (a[1] != "127.0.0.1") printf a[1]" "}'
The text was updated successfully, but these errors were encountered:
All linux distro don't have the -I option for hostname.
Simply not true: -I, --all-ip-addresses all addresses for the host
Looks like gentoo provides hostname in a different manner that the debian/ubuntu based ones.
We'll consider a more generalized way of retrieving all ip addresses of the host, thx
true, i didn't think of ipv6.
Yes your snippet works as intended.
good idea using scope global.. here's my initial code using scope global and including ipv6
ip addr show | awk '/inet6? / && index($0, "scope global") > 0 {split($2, a, "/"); printf a[1]" "}'
When running /lib/Froxlor/Cli/InstallCommand.php i'm getting an error with hostname -I not being a valid command
System information
To Reproduce
php ./bin/froxlor-cli froxlor:install
Logfiles
hostname: invalid option -- 'I'
Additional context
hostname utility is part of sys-apps/net-tools package on Gentoo.
All linux distro don't have the -I option for hostname.
I suggest the following one liner which will give you similar results, the output is one ip per line, so you shouldn't need to do an explode as it should directly be an array
ip addr show | awk '/inet / {split($2, a, "/"); if (a[1] != "127.0.0.1") print a[1]}'
if you want it to have the same output as you already have :
ip addr show | awk '/inet / {split($2, a, "/"); if (a[1] != "127.0.0.1") printf a[1]" "}'
The text was updated successfully, but these errors were encountered: