[arch-general] Set ip lan address /etc/environment

Mark . tera_1225 at hotmail.com
Wed May 30 11:33:06 UTC 2018


Perhaps head over to #archlinux on Freenode irc to get some more
interactive help…?


On 30/05/2018 13:31, Maykel Franco via arch-general wrote:
> 2018-05-30 13:20 GMT+02:00 Ralph Corderoy <ralph at inputplus.co.uk>:
>> Hi Maykel,
>>
>>> $ source /etc/environment
>>> ip="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
>> https://wiki.archlinux.org/index.php/Environment_variables#Globally says
>> /etc/environment doesn't take code, just simple assignments.
>> Also see pam_env(8) and the rest of that wiki page.
>>
>> --
>> Cheers, Ralph.
>> https://plus.google.com/+RalphCorderoy
>
> Thanks for your response but doesn't work
>
> Put file /etc/profile.d/ip.sh with the content:
>
> ip="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d
> ' ' -f 1)"
>
> Not work.
>
> And I probe this:
>
> /etc/security/pam_env.conf :
>
> ip              DEFAULT=""      OVERRIDE="$(ifconfig | grep -A 1
> 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
>
> And not working...



More information about the arch-general mailing list