mps.kurban-kurtarma

This commit is contained in:
milisman 2016-10-27 23:45:46 +03:00
parent 3655caed73
commit 536ee4844e
1 changed files with 32 additions and 1 deletions

33
bin/mps
View File

@ -4,7 +4,7 @@ if [ -f /etc/mps.conf ];then
. /etc/mps.conf
fi
. /root/bin/fonks.sh
versiyon="0.8.3"
versiyon="0.8.4"
iletisim="milisarge@gmail.com"
paketdepo="/depo/paketler/"
if [ -z ${sunucu+:} ]; then
@ -514,6 +514,35 @@ silme_kurban_kontrol(){
done
}
kurban_kurtar(){
local dizin paket
paket=$1
if [ -f /var/lib/pkg/DB/$paket/kurulan ];then
cat /var/lib/pkg/DB/$paket/kurulan | cut -d '>' -f2 > /tmp/$paket.sil
for f in $(cat /tmp/$paket.sil) ; do
dizin="${f%\'}"
dizin="${dizin#\'}"
if [ -d "$dizin" ];then
for g in `ls "$dizin"` ; do
if ! grep -Fxq " '$dizin/$g'" "/tmp/$paket.sil"
then
if [ -f /tmp/$paket.kurtar ];then
rm /tmp/$paket.kurtar
fi
echo " '$dizin'" >> "/tmp/$paket.kurtar"
fi
done
fi
done
mv /var/lib/pkg/DB/$paket/kurulan /var/lib/pkg/DB/$paket/ilk.kurulan
grep -v -F -x -f "/tmp/$paket.kurtar" "/tmp/$paket.sil" > /var/lib/pkg/DB/$paket/kurulan
rm -f /tmp/$paket.sil
ryaz 32 "$paket kurban dosyaları kurtarıldı."
else
ryaz 31 "kurulan paket yok!"
fi
}
ters_bagimli_kontrol(){
ters_bagimli "$1" | sort > tersb.liste
ls /var/lib/pkg/DB/ | sed "/$1/d" | sort > simdiki.liste
@ -1085,6 +1114,8 @@ ayarlar() {
ryaz 31 `kurulu_kontrol "$2"`;;
-kudo)
kurulum_dogrulama ;;
-kdk)
kurban_kurtar $2 ;;
-suko)
sunucu_kontrol ;;
-cf|--config-file)