Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente | Prochaine révision Les deux révisions suivantes | ||
shred [Le 21/03/2018, 08:56] 80.14.250.176 [Intégrer Shred à Nautilus Script] |
shred [Le 16/05/2019, 16:57] 192.54.144.229 [Intégrer Shred à Nautilus Script] |
||
---|---|---|---|
Ligne 71: | Ligne 71: | ||
if [[ -a /dev/urandom ]]; then | if [[ -a /dev/urandom ]]; then | ||
- | randomizer=/dev/urandom; | + | randomizer=/dev/urandom; |
fi | fi | ||
- | echo $NAUTILUS_SCRIPT_SELECTED_URIS > ~/.gnome2/temp_shred_list | + | SHRED="shred --remove=wipesync --zero --iterations=99 ${randomizer}" |
- | zenity --question --title "Destruction de fichier" --text "Voulez-vous vraiment supprimer ce fichier?" | + | echo ${NAUTILUS_SCRIPT_SELECTED_URIS} > ~/.gnome2/temp_shred_list |
+ | |||
+ | zenity --question --title "Destruction de fichier" --text "Voulez-vous vraiment supprimer ce fichier ?" | ||
if (( $? == 0 )); then | if (( $? == 0 )); then | ||
- | for file in $(cat ~/.gnome2/temp_shred_list); do | ||
- | shortfile=$(echo $file | sed -e 's/\%20/\ /g' -e 's/.*\///g') | + | for file in $(cat ~/.gnome2/temp_shred_list); do |
- | file_name=$(echo $file | sed -e 's/file:\/\///g' -e 's/\%20/\ /g') | + | shortfile=$(echo $file | sed -e 's/\%20/\ /g' -e 's/.*\///g') |
- | if [[ $randomizer == "" ]]; then | + | file_name=$(echo $file | sed -e 's/file:\/\///g' -e 's/\%20/\ /g') |
- | shred -u -z -n 99 "$file_name" | + | |
- | if (( $? == 0 )); then | + | |
- | zenity --info --text="$shortfile Suppression définitive terminée" --title "Opération réussite" | + | |
- | else zenity --info --text="$shortfile Suppression impossible" --title "Opération annulée" | + | |
- | fi | + | |
- | else shred -u -z -n 99 --random-source=$randomizer "$file_name" | + | |
- | if (( $? == 0 )); then | + | |
- | zenity --info --text="$shortfile Suppression définitive terminée" --title "Opération réussite" | + | |
- | else zenity --info --text="$shortfile Suppression impossible" --title "Opération annulée" | + | |
- | fi | + | |
- | fi | + | |
- | done | + | ${SHRED} "${file_name}" |
- | fi | + | |
+ | if (( $? == 0 )); then | ||
+ | zenity --info --text="${shortfile} Suppression définitive terminée" --title "Opération réussite" | ||
+ | else | ||
+ | zenity --info --text="${shortfile} Suppression impossible" --title "Opération annulée" | ||
+ | fi | ||
+ | |||
+ | done | ||
+ | |||
+ | fi | ||
- | rm -f ~/.gnome2/temp_shred_list</file> | + | ${SHRED} ~/.gnome2/temp_shred_list |
+ | </file> | ||
===== Voir aussi ===== | ===== Voir aussi ===== | ||