Bash script to monitor internal IP for changes

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I would like to know if a script can the the information from an ifconfig...



eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 111.222.111.222 netmask 255.255.255.0 broadcast 111.222.111.255
inet6 fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
ether f0:de:f1:f1:65:70 txqueuelen 1000 (Ethernet)
RX packets 3623628 bytes 428280329 (408.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1895180 bytes 1618756896 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf3900000-f3920000


And then dump the information to something like:



eth0
ipv4: 111.222.111.222 netmask: 255.255.255.0 broadcast 111.222.111.255
ipv6: fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>


I would like the script to include all enabled non-loopback interfaces. I would like to then set up cron to check for any changes, and then if there is a change, to email me all the information to my gmail. Any changes should either be bold or displayed in such a way it can be easily identified. Even if it is a different section.



I want to us 'ifconfig' and not 'ip' command.







share|improve this question


















  • 3




    What kind of progress have you made so far? Also, why not ip?
    – dsstorefile1
    Apr 19 at 21:36










  • No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
    – user2616163
    Sep 6 at 20:36














up vote
0
down vote

favorite












I would like to know if a script can the the information from an ifconfig...



eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 111.222.111.222 netmask 255.255.255.0 broadcast 111.222.111.255
inet6 fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
ether f0:de:f1:f1:65:70 txqueuelen 1000 (Ethernet)
RX packets 3623628 bytes 428280329 (408.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1895180 bytes 1618756896 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf3900000-f3920000


And then dump the information to something like:



eth0
ipv4: 111.222.111.222 netmask: 255.255.255.0 broadcast 111.222.111.255
ipv6: fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>


I would like the script to include all enabled non-loopback interfaces. I would like to then set up cron to check for any changes, and then if there is a change, to email me all the information to my gmail. Any changes should either be bold or displayed in such a way it can be easily identified. Even if it is a different section.



I want to us 'ifconfig' and not 'ip' command.







share|improve this question


















  • 3




    What kind of progress have you made so far? Also, why not ip?
    – dsstorefile1
    Apr 19 at 21:36










  • No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
    – user2616163
    Sep 6 at 20:36












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I would like to know if a script can the the information from an ifconfig...



eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 111.222.111.222 netmask 255.255.255.0 broadcast 111.222.111.255
inet6 fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
ether f0:de:f1:f1:65:70 txqueuelen 1000 (Ethernet)
RX packets 3623628 bytes 428280329 (408.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1895180 bytes 1618756896 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf3900000-f3920000


And then dump the information to something like:



eth0
ipv4: 111.222.111.222 netmask: 255.255.255.0 broadcast 111.222.111.255
ipv6: fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>


I would like the script to include all enabled non-loopback interfaces. I would like to then set up cron to check for any changes, and then if there is a change, to email me all the information to my gmail. Any changes should either be bold or displayed in such a way it can be easily identified. Even if it is a different section.



I want to us 'ifconfig' and not 'ip' command.







share|improve this question














I would like to know if a script can the the information from an ifconfig...



eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 111.222.111.222 netmask 255.255.255.0 broadcast 111.222.111.255
inet6 fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
ether f0:de:f1:f1:65:70 txqueuelen 1000 (Ethernet)
RX packets 3623628 bytes 428280329 (408.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1895180 bytes 1618756896 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf3900000-f3920000


And then dump the information to something like:



eth0
ipv4: 111.222.111.222 netmask: 255.255.255.0 broadcast 111.222.111.255
ipv6: fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>


I would like the script to include all enabled non-loopback interfaces. I would like to then set up cron to check for any changes, and then if there is a change, to email me all the information to my gmail. Any changes should either be bold or displayed in such a way it can be easily identified. Even if it is a different section.



I want to us 'ifconfig' and not 'ip' command.









share|improve this question













share|improve this question




share|improve this question








edited Sep 6 at 20:33

























asked Apr 19 at 20:20









user2616163

283




283







  • 3




    What kind of progress have you made so far? Also, why not ip?
    – dsstorefile1
    Apr 19 at 21:36










  • No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
    – user2616163
    Sep 6 at 20:36












  • 3




    What kind of progress have you made so far? Also, why not ip?
    – dsstorefile1
    Apr 19 at 21:36










  • No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
    – user2616163
    Sep 6 at 20:36







3




3




What kind of progress have you made so far? Also, why not ip?
– dsstorefile1
Apr 19 at 21:36




What kind of progress have you made so far? Also, why not ip?
– dsstorefile1
Apr 19 at 21:36












No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
– user2616163
Sep 6 at 20:36




No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
– user2616163
Sep 6 at 20:36















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026515%2fbash-script-to-monitor-internal-ip-for-changes%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026515%2fbash-script-to-monitor-internal-ip-for-changes%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Which professions warranted travel in Medieval times?

How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

Trouble downloading packages list due to a “Hash sum mismatch” error