milis/bin/ks

21 lines
432 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# kullanıcı silme
kullanici_sil(){
if [ $1 ];then
_isim=$1
if [ "$_isim" == "`cat /etc/passwd | grep $_isim | cut -d':' -f1`" ];then
userdel -f $_isim
echo "kullanıcı dizini silinecek"
[ -d /home/$_isim ] && rm -rf /home/$_isim || echo "kullanıcı dizini bulunamadı"
else
echo "$_isim kullanıcısı bulunamadı"
fi
else
echo "kullanıcı parametresi eksik"
fi
}
kullanici_sil $1
exit 0