Kod: Zaznacz cały
echo -e '\a'
/etc/rc.local
Kod: Zaznacz cały
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/home/qwlxatyn/bin/ntst4 &
exit 0
Kod: Zaznacz cały
#!/bin/bash
export XAUTHORITY=/home/qwlxatyn/.Xauthority
export DISPLAY=':0'
sc=/home/qwlxatyn/Desktop
sc1=/tmp
>$sc1/tmp4.txt
>$sc/ntst4ps.txt
>$sc/ntst4.txt
>$sc1/ps.txt
licz=0
while [ $licz = 0 ]
do
netstat -apntu | egrep -v -i 'firefox|chrome|java|klauncher|ESTABLISHED -|VirtualBox' | grep ESTABLISHED >$sc1/tmp4.txt &&
(echo -e '\a'; notify-send " Jest Polączenie")
ps -ef | grep -v "defunc" >$sc1/ps.txt
cat $sc1/tmp4.txt >>$sc/ntst4.txt
/home/qwlxatyn/bin/pid_perl
sleep 5
done
Kod: Zaznacz cały
#!/usr/bin/perl
$plik = '/tmp/tmp4.txt';
open(DANE, $plik);
@tabela = <DANE>;
close(DANE);
$ile_lini = $#tabela;
for ($i = 0; $i <= $ile_lini; $i++) {
$znaczek = '';
$pid = '';
$pozycja_znaczka = 80;
while ($znaczek ne '/') {
$znaczek = substr($tabela[$i], $pozycja_znaczka, 1);
$pozycja_znaczka++;
$pid = $pid . $znaczek;
}
$pid = substr($pid, 0, -1);
system "cat /tmp/ps.txt | grep $pid >>/home/qwlxatyn/Desktop/ntst4ps.txt";
}