help with xchat script

Discussion about Perl, TCL or Python scripts and C/C++ plugins (using and writing them).

help with xchat scri

Postby piratpalle » 28 Dec 2008 14:21

I found this on the net:

Is there someone how can help me to get it to respon på ".bw" and not "/yasis -b" and to be triggert from another user?

Box user: LillePil
Normal User: Apache (.bw - Lillepil executes the command)

Code: Select all
#!/usr/bin/perl
# System Information Script originally for X-Chat, by s0ulslack (Tony Annen)
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: ~/.xchat2/yasis.pl, v3.2 2008/10/16 012:42:00 $

# Having problems with lspci? make sure you have pciutils installed.
# Also, if your running any kernel patches that increase security (like grsec)
# it may break this script or report errors! (thanks to TMS)
# Need help or wanna chat? /msg s0ulslack on Undernet or Freenode

# Click Settings -> Advanced -> User Commands...
# Click Add New Twice, and edit it so the Names/Commands are like below

# Name                 Command
# yasis                exec -o ~/.xchat2/yasis-3.2.pl %2
# yasishelp            exec ~/.xchat2/yasis-3.2.pl -h

# Make sure the path is correct and Save

$sver="v3.2";

# Figure out (try to) where lspci is located
if(-e "/usr/sbin/lspci"){
  $lspci="/usr/sbin/lspci";
}elsif(-e "/sbin/lspci"){
  $lspci="/sbin/lspci";
}elsif(-e "/bin/lspci"){
  $lspci="/bin/lspci";
}elsif(-e "/usr/bin/lspci"){
  $lspci="/usr/bin/lspci";
}

if(!$lspci){
  system("echo pciutils is not installed or lspci wasn't found!");
  system("echo check the top of the yasis file for more info.");
  exit;
}

if($ARGV[0]){
    $switch=$ARGV[0];
}

# CPU Load (only tested with one cpu)
$cpu_load=`export TERM=dumb; top -b -d .1 -n2 | grep "Cpu(s)" | awk '{print \$2}' | tail -n1 | sed 's/%//'`; chop($cpu_load);
$cpu_load=sprintf("%.0f",($cpu_load));
$cpu_load="$cpu_load% load)";

# Kernel Version
$uname=`uname -r`; chop($uname);

# CPU
$cpu=cat("/proc/cpuinfo");
if($cpu=~/sparc/){
  $cpu=~ /(.*sparc.*)/;
  @cpumodel=split/:/,$1;
  $cpumodel=$cpumodel[1];
  $cpumodel=~ s/ //;
  $cpu=~ /(.*bogomips.*)/;
  @cpumhz=split/:/,$1;
  $cpumhz=sprintf ("%.f",$cpumhz[1]);
  $cpuinf="$cpumodel";
}elsif($cpu=~/ 486/){
  $cpu=~ /(.*model name.*)/;
  @cpumodel=split/:/,$1;
  $cpumodel=$cpumodel[1];
  $cpumodel=~ s/ //;
  $cpu=~ /(.*bogomips.*)/;
  @cpumhz=split/:/,$1;
  $cpumhz=sprintf ("%.f",$cpumhz[1]);
  $cpuinf="$cpumodel";
}else{
  $cpu=~ /(.*model name.*)/;
  @cpumodel=split/:/,$1;
  $cpumodel=$cpumodel[1];
  $cpumodel=~ s/ //;
  $cpu=~ /(.*cpu MHz.*)/;
  @cpumhz=split/:/,$1;
  $cpumhz=sprintf ("%.f",$cpumhz[1]);
  $cpuinf="$cpumodel";
}

$cpus=`grep 'processor' /proc/cpuinfo | wc -l | sed 's/ *//'`; chop($cpus);
$cache=`grep 'cache size' /proc/cpuinfo | head -n 1 | sed -e 's/^.*: //'| sed 's/ //'`; chop($cache);

# CPU Temp (requires the "sensors" command to be in $PATH)
if(-e "/usr/bin/sensors"){ $sensors="/usr/bin/sensors"; }
if(-e "/bin/sensors"){ $sensors="/bin/sensors"; }
if(-e "/usr/sbin/sensors"){ $sensors="/usr/sbin/sensors"; }
if(-e "/sbin/sensors"){ $sensors="/sbin/sensors"; }
if($sensors){
  $cpu_tempc=`sensors | grep CPU | awk '{print \$3}' | sed 's/.*+//'`; chop($cpu_tempc);
  $cpu_tempf=`sensors -f | grep CPU | awk '{print \$3}' | sed 's/.*+//'`; chop($cpu_tempf);
  $cpu_rpm=`sensors | grep fan1 | awk '{print \$2,\$3}' | sed 's/.*+//'`; chop($cpu_rpm);
}

# Memory
$mem_total=`free | grep Mem | awk '{printf (\"%dMm\", \$2/1024 )}'`; chop($mem_total);
$mem_free=`free | grep Mem | awk '{printf (\"%.0fMm\", ( \$3 -(\$6 + \$7) )/1024)}'`; chop($mem_free);
$mem_per=`free -m | grep Mem | awk '{printf (\"%.0f\", (\$2 - \$3 + \$6 + \$7) * (100/ \$2))}'`;
$buffered_mem=`free | grep Mem | awk '{printf (\"%.0fM\", (\$6)/1024)}'`;
$cached_mem=`free | grep Mem | awk '{printf (\"%.0fM\", (\$7)/1024)}'`;

# Swap (try to handle this smoothly)
$swapchk=`free -m | grep Swap | awk '{print \$2}'`;
if($swapchk != 0){
  $swap_total=`free | grep Swap | awk '{printf (\"%dMm\", \$2/1024 )}'`; chop($swap_total);
  $swap_free=`free | grep Swap | awk '{printf (\"%.0fMm\", ( \$3 -(\$6 + \$7) )/1024)}'`; chop($swap_free);
  $swap_per=`free -m | grep Swap | awk '{printf (\"%.0f\", (\$2 - \$3 + \$6 + \$7) * (100/ \$2))}'`;
}

## Video
$xchk=`ps ax | grep "[x]init" | wc -l`;
$gdmchk=`ps ax | grep "[g]dm-binary" | wc -l`;
$gdmchk2=`ps ax | grep "[g]dm" | wc -l`;
if($xchk > 0){
  $idchk=`ps aux | grep "[x]init " | awk '{print \$1}'`; $me=`whoami`;
  if($idchk eq $me){
    $do_display="1";
  }else{
##   NOTE: change this to "0" if root can't use xdpyinfo
##   to access other users X session stats... it'd be something
##   like "connection refused from 0:0" or along the lines
    $do_display="0";
  }
}elsif($gdmchk > 0 && $xchk == "0"){
  $do_display="1";
}elsif($gdmchk2 > 0 && $xchk == "0" && $gdmchk =="0"){
  $do_display="1";
}else{
  $do_display="0";
  $con_display="1";
}

if($do_display == "1"){
  $vid_card=`$lspci | grep VGA | sed 's/Technologies Inc //' | sed -e 's/.*: //' | sed 's/ (.*//' | tail -n1`;
  $vid_card=~ s/(.*)\[//; $vid_card=~ s/\]//; chop($vid_card);
  if(-x "/usr/X11R6/bin/xdpyinfo"){ $xdpy="/usr/X11R6/bin/xdpyinfo"; }
  if(-x "/usr/local/X11R6/bin/xdpyinfo"){ $xdpy="/usr/X11R6/bin/xdpyinfo"; }
  if(-x "/usr/bin/xdpyinfo"){ $xdpy="/usr/bin/xdpyinfo"; }
  if(-x "/usr/X11R6/bin/xrandr"){ $xrandr="/usr/X11R6/bin/xrandr"; }
  if(-x "/usr/local/X11R6/bin/xrandr"){ $xrandr="/usr/local/X11R6/bin/xrandr"; }
  if(-x "/usr/bin/xrandr"){ $xrandr="/usr/bin/xrandr"; }
  if($xrandr){
    $refrsh_rate = `$xrandr | grep "*" | awk '{print \$2}' | sed 's/\\..*//'`; chop($refrsh_rate);
    if($refrsh_rate){ $refrsh_rate="/${refrsh_rate}Hz"; }
  }
  if($xdpy){
    $screen_res=`$xdpy | grep dimensions | awk '{print \$2}'`; chop($screen_res);
    $screen_depth=`$xdpy | grep "depth of root window" | awk '{print \$5}'`; chop($screen_depth);
    # Get Xorg/Xfree version
    if(!$x){ $x=`$xdpy | grep XFree86"."version | awk '{print \$3}'`; if($x ne ""){ $x="XFree86 $x"; }} chomp($x);
    if(!$x){ $x=`$xdpy | grep X.Org"."version | awk '{print \$3}'`; if($x ne ""){ $x="X.Org $x"; }} chomp($x);
  }

if(!$screen_res){ $screen_res="Unknown Res"; }
if(!$screen_depth){ $screen_depth="Unknown"; }
if(!$x){ $x="Unknown X-Server"; }
if(!$refrsh_rate){ $refrsh_rate="/Unknown"; }

# Desktop Enviroment/Window Manager
$xfchk=`ps ax | grep [x]fwm4 | wc -l`; if($xfchk > 0){ $de=`xfwm4 --version | grep version | awk '{print \$5}'`; { $de="Xfce $de"; }}
$gchk=`ps ax | grep [g]nome-session | wc -l`; if($gchk > 0){ $de=`gnome-panel --version | sed 's/.*gnome-panel //'`; $de="Gnome $de"; }
$kdechk=`ps ax | grep [s]tartkde | wc -l`; if($kdechk > 0){ $de=`kde-config --version | grep "KDE:" | sed 's/://'`; }
$echk=`ps ax | grep [e]nlightenment | wc -l`; if($echk > 0){ $de=`enlightenment --version | grep Version | awk '{print \$1, \$3}'`; }
$fluxchk=`ps ax | grep [f]luxbox | wc -l`; if($fluxchk > 0){ $de=`fluxbox -version | grep Fluxbox | sed 's/-.*//' | sed 's/ :.*//'`; }
$bbchk=`ps ax | grep [b]lackbox | wc -l`; if($bbchk > 0){ $de=`blackbox --version | grep Blackbox | sed 's/ :.*//'`; }
$obchk=`ps ax | grep [o]penbox | wc -l`; if($obchk > 0){ $de=`openbox --version | grep Openbox`; }
$wmchk=`ps ax | grep [w]maker | wc -l`; if($wmchk > 0){ $de=`wmaker --version | grep "Window Maker"`; }
if(!$de){ $de="Unknown Desktop"; }
  chop($de);
}else{
  $vid_card=`$lspci | grep VGA | sed -e 's/.*: //' | sed 's/ (.*//' | tail -n1`;
  $vid_card=~ s/(.*)\[//; $vid_card=~ s/\]//; chop($vid_card);
}

# Hard Drive
$hdspacet = `df | awk '{ if (substr(\$1,1,1) == "/") sum+=\$2/1024^2 }; END { printf (\"%.02fG\", sum )}'`;
$hdspaceu = `df | awk '{ if (substr(\$1,1,1) == "/") sum+=\$3/1024^2 }; END { printf (\"%.02fG\", sum )}'`;
$hdspacef = `df | awk '{ if (substr(\$1,1,1) == "/") sum+=\$4/1024^2 }; END { printf (\"%.02fG\", sum )}'`;
$hdpercent = sprintf("%.0f",(100/${hdspacet}*${hdspacef}));

# Network (default and others)
$tmp="/tmp/.rinfo";
system(`/sbin/route -n > $tmp`);
open(ROUTE, "$tmp") or die;
@rinfo=<ROUTE>;
close(ROUTE) or die;
foreach $line (@rinfo){
  if($line=~/0.0.0.0/){
    ($dest, $gate, $mask, $flags, $metric, $ref, $use, $face)=split(/\s+/, $line, 8);
    chop($dest, $gate, $mask, $flags, $metric, $ref, $use, $face);
  }
  if($line=~/192.168/ or $line=~/10./){
    ($dest1, $gate1, $mask1, $flags1, $metric1, $ref1, $use1, $face1)=split(/\s+/, $line, 8);
    chop($dest1, $gate1, $mask1, $flags1, $metric1, $ref1, $use1, $face1);
  }
}

system(`rm -rf $tmp`);
if($face1 eq "$face"){ $face1=""; }
$ppp=`$lspci | grep Communication | sed 's/.*: //' | sed 's/ (.*//' | tail -n1`; chop($ppp);
$eth=`$lspci | grep Ethernet | sed 's/.*: //' | sed 's/ (.*//' | tail -n1 | sed 's/Corporation //'`; chop($eth);
if($face eq "ppp0"){ $eth_name=$ppp; $inet="ppp0"; }elsif($face eq "ppp1"){ $eth_name=$ppp; $inet="ppp1"; }elsif($face eq "ppp2"){ $eth_name=$ppp; $inet="ppp2"; }
if($face eq "eth0"){ $eth_name=$eth; $inet="eth0"; }elsif($face eq "eth1"){ $eth_name=$eth; $inet="eth1"; }elsif($face eq "eth2"){ $eth_name=$eth; $inet="eth2"; }
if($face eq "lo"){ $eth_name="Loop Back"; $inet="lo"; }

if($face1 eq "eth0"){ $eth_name1=$eth; $inet1="eth0"; }elsif($face1 eq "eth1"){ $eth_name1=$eth; $inet1="eth1"; }elsif($face1 eq "eth2"){ $eth_name1=$eth; $inet1="eth3"; }
if($face && $face1){ $facep=$face; $facee=$face1; $face="${face}*, $face1"; }else{ $face="${face}"; }
if($face eq ""){ $face="Unknown Device"; }
if(!$eth_name){ $eth_name="Unknown Device"; }

# Network Traffic
if($inet && $inet1){
  $packet_inp=`grep $inet /proc/net/dev | awk -F: '/:/ {print \$2}' | awk '{printf \$1}'`;
  $packet_outp=`grep $inet cat /proc/net/dev | awk -F: '/:/ {print \$2}' | awk '{print \$9}'`;
  $packet_ine=`grep $inet1 cat /proc/net/dev | awk -F: '/:/ {print \$2}' | awk '{printf \$1}'`;
  $packet_oute=`grep $inet1 cat /proc/net/dev | awk -F: '/:/ {print \$2}' | awk '{print \$9}'`;
  $packet_in=$packet_inp+$packet_ine;
  $packet_out=$packet_outp+$packet_oute;
    if($packet_inp < 1024**3){ $packet_inp=sprintf("%.02f",$packet_inp / 1024**2)."M"; }else{ $packet_inp=sprintf("%.02f", $packet_inp / 1024**3)."G"; }
    if($packet_outp < 1024**3){ $packet_outp=sprintf("%.02f",$packet_outp / 1024**2)."M"; }else{ $packet_outp=sprintf("%.02f", $packet_outp / 1024**3)."G"; }
    if($packet_ine < 1024**3){ $packet_ine=sprintf("%.02f",$packet_ine / 1024**2)."M"; }else{ $packet_ine=sprintf("%.02f", $packet_ine / 1024**3)."G"; }
    if($packet_oute < 1024**3){ $packet_oute=sprintf("%.02f",$packet_oute / 1024**2)."M"; }else{ $packet_oute=sprintf("%.02f", $packet_oute / 1024**3)."G"; }
    if($packet_in < 1024**3){ $packet_in=sprintf("%.02f",$packet_in / 1024**2)."M"; }else{ $packet_in=sprintf("%.02f", $packet_in / 1024**3)."G"; }
    if($packet_out < 1024**3){ $packet_out=sprintf("%.02f",$packet_out / 1024**2)."M"; }else{ $packet_out=sprintf("%.02f", $packet_out / 1024**3)."G"; }
  }elsif($inet){
    $packet_in=`grep $inet /proc/net/dev | awk -F: '/:/ {print \$2}' | awk '{printf \$1}'`;
    $packet_out=`grep $inet /proc/net/dev | awk -F: '/:/ {print \$2}' | awk '{print \$9}'`;
    if($packet_in < 1024**3){ $packet_in=sprintf("%.02f",$packet_in / 1024**2)."M"; }else{ $packet_in=sprintf("%.02f", $packet_in / 1024**3)."G"; }
    if($packet_out < 1024**3){ $packet_out=sprintf("%.02f",$packet_out / 1024**2)."M"; }else{ $packet_out=sprintf("%.02f", $packet_out / 1024**3)."G"; }
  }else{
    $packet_in="0.00M";
    $packet_out="0.00M";
}

# Network device speed (in/out, only for one device atm)
# and yes, this isn't exactly pretty but works for now :p
$fst=`grep $inet /proc/net/dev | awk '{print \$1}' | sed 's/.*://'`;
$fsto=`grep $inet /proc/net/dev | awk '{print \$9}' | sed 's/.*://'`;
sleep 1;
$scnd=`grep $inet /proc/net/dev | awk '{print \$1}' | sed 's/.*://'`;
$scndo=`grep $inet /proc/net/dev | awk '{print \$9}' | sed 's/.*://'`;
$total=sprintf("%.02f",$scnd - $fst)."f";
$totalo=sprintf("%.02f",$scndo - $fsto)."f";
$total=sprintf("%.0f",$total / 1024)."kB/ss";
$totalo=sprintf("%.0f",$totalo / 1024)."kB/ss";
chop($fst,$scnd,$total,$fsto,$scndo,$totalo);

# uptime stuff
$uptime=`uptime`;
chop($uptime);
$uptime=~ /.+ up (.+),.+[0-9]+ user/;
$uptime=$1;
if($uptime=~ /(.*day.*)/){
  $uptime=~ s/  / /;
}else{
  $uptime=~ s/ //;
}

# best uptime related
$buchk=`ls -asl ~/ | grep .buptime | wc -l`;
if($buchk == "0"){ system("cat /proc/uptime | awk '{printf \$1}' > ~/.buptime_uptime"); system("echo \"$uptime\" > ~/.buptime"); }
$cu=`cat /proc/uptime | awk '{printf \$1}'`; chop($cu);
$bu=`cat ~/.buptime_uptime`; chop($bu);
$buptime=`cat ~/.buptime | sed 's/ //'`; chop($buptime);

# Distro related
if(-e "/etc/gentoo-release"){ $distro=`cat /etc/gentoo-release | sed 's/version //' | sed 's/release //'`; }
if(-e "/etc/slackware-version"){ $distro=`cat /etc/slackware-version | sed 's/version //'`; }
if(-e "/etc/redhat-release"){ $distro=`cat /etc/redhat-release | sed 's/version //'`; }
if(-e "/etc/mandrake-release"){ $distro=`cat /etc/mandrake-release | sed 's/version //'`; }
if(-e "/etc/debian_version"){ $distro="Debian ".`cat /etc/debian_version | sed 's/version //'`.""; }
if(-e "/etc/SuSE-release"){ $distro=`cat /etc/SuSE-release | head -n1 | sed 's/version //'`; }
if(-e "/etc/turbolinux-release"){ $distro=`cat /etc/turbolinux-release | sed 's/version //'`; }
if(-e "/etc/libranet_version"){ $distro="Libranet-`cat /etc/libranet_version | sed 's/version //'`"; }
if(-e "/etc/arch-release"){ $distro=`cat /etc/arch-release | sed 's/version //'`; }
if(-e "/etc/lunar.release"){ $distro=`cat /etc/lunar.release`; }
if(-e "/etc/bluewhite64-version"){ $distro=`cat /etc/bluewhite64-version`; }
if($distro eq ""){ $distro="Unknown Distro"; } chop($distro);

if($switch=~/[i-l]/ or $switch=~/[p-r]/ or $switch=~/[w-z]/){
  $final="";
}elsif($switch=~/d/){
  $final="[Disk]  $hdspaceu of $hdspacet ($hdpercent% Free)";
}elsif($switch=~/m/){
  $swapused=`free -m | grep Swap | awk '{print \$3}'`;
  if($swapused != 0){
    $final="[Memory]  Physical: $mem_free of $mem_total ($mem_per% Free/$buffered_mem Buffered/$cached_mem Cached) :: Swap: $swap_free of $swap_total ($swap_per% Free)";
  }else{
    $final="[Memory]  $mem_free of $mem_total ($mem_per% Free/$buffered_mem Buffered/$cached_mem Cached)";
  }
}elsif($switch=~/s/){
  if($cu > $bu){ system("echo \"$uptime\" > ~/.buptime"); system("echo \"$cu\" > ~/.buptime_uptime"); }
  if($cache){ $cache="(${cpumhz}MHz/"; }
  if(!$cache){ $cache="(${cpumhz}MHz";}
  $final="[OS]  $distro ($uname up $uptime) :: [CPU] $cpus-$cpuinf ${cache}$cpu_load :: [Memory] $mem_free of $mem_total ($mem_per% Free) :: [Disk] $hdspaceu of $hdspacet ($hdpercent% Free) :: [Network] $face: $packet_in In/$packet_out Out";
}elsif($switch=~/t/){
  if(!$cpu_tempc and !$cpu_tempf and !$cpu_rpm){
    $final="[CPU  Temp] No Sensors";
  }else{
    $final="[CPU  Temp] $cpu_tempf($cpu_tempc :: $cpu_rpm)";
#    $final="[CPU  Temp] $cpu_temp1 (fan: $cpu_rpm)";
}
}elsif($switch=~/v/){
  if(!$screen_res and !$screen_depth){
    $final="[Video]  No Display";
  }elsif($vid_card and $con_display){
    $final="[Video]  $vid_card";
  }else{
    $final="[Video]  ${de}/$x (${screen_res}/${screen_depth} Bit${refrsh_rate})";
#    $final="[Video]  ${de}/$x (${vid_card}/${screen_res}/${screen_depth} Bit${refrsh_rate})";
}
}elsif($switch=~/n/){
  if($face && $face1){
    if($facep=~/ppp[0-2]/){ $facep="${inet}"; }
    if($facee=~/eth[0-2]/ && $inet1){ $facee="${inet1}"; }
    $pinfo="($facep: $packet_inp In/$packet_outp Out :: $facee: $packet_ine In, $packet_oute Out)";
  }elsif($face){
    if($face=~/ppp[0-2]/){ $face="${inet}"; }
    if($face=~/eth[0-2]/ && $inet){ $face="${inet}"; }
    $pinfo="($face: $packet_in In($total), $packet_out Out($totalo))";
}
  $final="[Network]  $eth_name $pinfo";
#
}elsif($switch=~/b/){
 if($face){
   if($face=~/ppp[0-2]/){ $face="${inet}"; }
   if($face=~/eth[0-2]/ && $inet){ $face="${inet}"; }
   #$pinfo="In: ${total} ($packet_in) :: Out: ${totalo} ($packet_out)";
   $pinfo="Down Speed: 4 ${total} :: Up Speed: 3 ${totalo}";
 }
  #$final="[Bandwidth]  $pinfo";
  $final="[SeedBox]  $pinfo";
}elsif($switch=~/h/){
  $z="/yasis";
  $final="[commands]
   $z -a (all(full) info)
  $z -b (network bandwidth)
  $z -c (cpu count,speed,cache,load)
  $z -d (disk space used,total,free)
  $z -m (memory/swap used,total,buffered,cached)
  $z -n (network card,iface,in/out traffic/speed)
  $z -o (distro/kernel version and uptime)
  $z -s (short info, no video)
  $z -t (cpu temp/fan rpm)
  $z -u (uptime and best)
  $z -v (enviroment,x11,card,res,bpp)";
}elsif($switch=~/o/){
  $final="[OS]  ${distro} ($uname up $uptime)";
}elsif($switch=~/c/){
  if($cache){
    $cache="(${cpumhz}MHz/$cache/";
  }else{
    $cache="(${cpumhz}MHz";
  }
  $final="[CPU]  $cpus-$cpuinf ${cache}$cpu_load";
}elsif($switch=~/u/){
  if($cu > $bu){ system("echo \"$uptime\" > ~/.buptime"); system("echo \"$cu\" > ~/.buptime_uptime"); }
  $buptime=`cat ~/.buptime`; chop($buptime);
  if($cu < $bu){
    $final="[Uptime]  $uptime (Best: $buptime)";
  }else{
    $final="[Uptime]  $uptime (Best: Current)";
  }
}else{
if($cu > $bu){ system("echo \"$uptime\" > ~/.buptime"); system("echo \"$cu\" > ~/.buptime_uptime"); }
if($cache){ $cache="(${cpumhz}MHz/$cache/"; }
if(!$cache){ $cache="(${cpumhz}MHz";}
  if($do_display == "1"){
    $final="[OS]  $distro ($uname up $uptime) :: [CPU] $cpus-$cpuinf ${cache}$cpu_load :: [Memory] $mem_free of $mem_total ($mem_per% Free) :: [Disk] $hdspaceu of $hdspacet ($hdpercent% Free) :: [Video] $vid_card (${screen_res}/${screen_depth} Bit${refrsh_rate}) :: [Network] $eth_name ($face: $packet_in In/$packet_out Out)";
  }else{
    $final="[OS]  $distro ($uname up $uptime) :: [CPU] $cpus-$cpuinf ${cache}$cpu_load :: [Memory] $mem_free of $mem_total ($mem_per% Free) :: [Disk] $hdspaceu of $hdspacet ($hdpercent% Free) :: [Video] $vid_card :: [Network] $eth_name ($face: $packet_in In/$packet_out Out)";
  }
}

$final=~ s/ //;
print "$final\n";

sub cat {
  my @file;
  open MYFILE, $_[0] or die "$!";
  @file=<MYFILE>;
  close MYFILE;
  return (wantarray) ? @file : join("",  @file);
}
piratpalle
 
Posts: 12
Joined: 12 Sep 2008 19:39

Postby s0ulslack » 30 Dec 2008 01:19

Your trying to change the command that executes it? Read the top of the script, it explains it.

If you have any other questions, /msg s0ulslack on Undernet/Freenode/EFnet
s0ulslack
 
Posts: 13
Joined: 07 Oct 2005 12:18
Location: Idaho


Return to Scripts and Plugins

Who is online

Users browsing this forum: No registered users and 1 guest