Skip to content

Commit

Permalink
Replace ip-screen C source with Perl
Browse files Browse the repository at this point in the history
  • Loading branch information
zeha committed Oct 4, 2024
1 parent bad8883 commit 792d5ef
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 93 deletions.
5 changes: 1 addition & 4 deletions compile/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROGS = ip-screen cpu-screen
PROGS = cpu-screen

#ifndef CFLAGS
CFLAGS = -O2 -Wall -s
Expand All @@ -14,9 +14,6 @@ CC = gcc

all: $(PROGS)

ip-screen: ip-screen.c
diet $(CC) $(CFLAGS) -o $@ $^

cpu-screen: cpu-screen.c
diet $(CC) $(CFLAGS) -o $@ $^

Expand Down
87 changes: 0 additions & 87 deletions compile/ip-screen.c

This file was deleted.

1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Depends:
dash,
grml-etc-core,
less,
libio-interface-perl,
lockfile-progs,
perl,
screen,
Expand Down
1 change: 0 additions & 1 deletion debian/grml-scripts-core.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
compile/cpu-screen usr/bin/
compile/ip-screen usr/bin/
usr_bin/* usr/bin/
1 change: 0 additions & 1 deletion debian/grml-scripts-core.lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
grml-scripts-core: statically-linked-binary [usr/bin/cpu-screen]
grml-scripts-core: statically-linked-binary [usr/bin/ip-screen]
grml-scripts-core: bugs-field-does-not-refer-to-debian-infrastructure mailto:[email protected]
grml-scripts-core: script-with-language-extension [usr/bin/lesspipe.sh]
15 changes: 15 additions & 0 deletions usr_bin/ip-screen
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/perl
use strict;
use IO::Interface::Simple;

my @interfaces = IO::Interface::Simple->interfaces;
my $found = 0;
for my $if (@interfaces) {
next if $if->is_loopback;
print " | " if $found;
print $if->address;
$found = 1;
}
print "[ network n/a ]" unless $found;
print "\n";

0 comments on commit 792d5ef

Please sign in to comment.