kontrollu-silme

This commit is contained in:
milisbir 2016-04-16 21:32:13 +00:00
parent f767f27a79
commit abafc7d2a4
1 changed files with 21 additions and 1 deletions

22
bin/mps
View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
. /etc/mpsd.conf . /etc/mpsd.conf
. /root/bin/fonks.sh . /root/bin/fonks.sh
versiyon="0.3" versiyon="0.4"
iletisim="milisarge@gmail.com" iletisim="milisarge@gmail.com"
paketdepo="/depo/paketler/" paketdepo="/depo/paketler/"
sunucu="192.168.1.66:8000/" sunucu="192.168.1.66:8000/"
@ -86,6 +86,10 @@ paket_sil(){
ryaz 31 "------------------" ryaz 31 "------------------"
ters_bagimli_kontrol "$paket" ters_bagimli_kontrol "$paket"
ryaz 31 "------------------" ryaz 31 "------------------"
ryaz 31 "kurban dosyalar"
ryaz 31 "------------------"
silme_kurban_kontrol /tmp/$paket.sil
ryaz 31 "------------------"
if [ "$oto_silme" = "evet" ];then if [ "$oto_silme" = "evet" ];then
sil_onay="e" sil_onay="e"
else else
@ -305,6 +309,22 @@ ters_bagimli(){
grep -rli "$ara" "$talimatname_dizin" | cut -d'/' -f`expr $sy + 3` grep -rli "$ara" "$talimatname_dizin" | cut -d'/' -f`expr $sy + 3`
} }
silme_kurban_kontrol(){
local dizin
for f in $(cat $1) ; do
dizin="${f%\'}"
dizin="${dizin#\'}"
if [ -d "$dizin" ];then
for g in `ls "$dizin"` ; do
if ! grep -Fxq " '$dizin/$g'" "$1"
then
echo "$dizin/$g"
fi
done
fi
done
}
ters_bagimli_kontrol(){ ters_bagimli_kontrol(){
ters_bagimli "$1" | sort > tersb.liste ters_bagimli "$1" | sort > tersb.liste
ls /var/lib/pkg/DB/ | sed "/$1/d" | sort > simdiki.liste ls /var/lib/pkg/DB/ | sed "/$1/d" | sort > simdiki.liste