mirror of
https://github.com/sunknudsen/privacy-guides.git
synced 2025-02-23 09:13:56 +00:00
Polished scripts
This commit is contained in:
parent
09667692cd
commit
4ff43c6f2b
@ -11,7 +11,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
"Usage: qr-clone.sh [options]" \
|
"Usage: qr-clone.sh [options]" \
|
||||||
"" \
|
"" \
|
||||||
"Options:" \
|
"Options:" \
|
||||||
" -h, --help display help for command"
|
" -h, --help display help for command"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
Binary file not shown.
@ -11,8 +11,8 @@ while [[ $# -gt 0 ]]; do
|
|||||||
"Usage: qr-restore.sh [options]" \
|
"Usage: qr-restore.sh [options]" \
|
||||||
"" \
|
"" \
|
||||||
"Options:" \
|
"Options:" \
|
||||||
" --word-list split secret into word list" \
|
" --word-list split secret into word list" \
|
||||||
" -h, --help display help for command"
|
" -h, --help display help for command"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
--word-list)
|
--word-list)
|
||||||
@ -68,9 +68,13 @@ if [ "$answer" = "y" ]; then
|
|||||||
if [ "$word_list" = true ]; then
|
if [ "$word_list" = true ]; then
|
||||||
printf "%s" "Secret: "
|
printf "%s" "Secret: "
|
||||||
array=($secret)
|
array=($secret)
|
||||||
for i in ${!array[@]}; do
|
last_index=$(echo "${#array[@]} - 1" | bc)
|
||||||
position=$(($i + 1))
|
for index in ${!array[@]}; do
|
||||||
printf "%d. $bold%s$normal " "$position" "${array[$i]}"
|
position=$(($index + 1))
|
||||||
|
printf "%d. $bold%s$normal" "$position" "${array[$index]}"
|
||||||
|
if [ $index -lt $last_index ]; then
|
||||||
|
printf " "
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
printf "\n"
|
printf "\n"
|
||||||
else
|
else
|
||||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
iterations=3
|
rounds=3
|
||||||
|
|
||||||
positional=()
|
positional=()
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
@ -11,13 +11,13 @@ while [[ $# -gt 0 ]]; do
|
|||||||
"Usage: secure-erase.sh [options]" \
|
"Usage: secure-erase.sh [options]" \
|
||||||
"" \
|
"" \
|
||||||
"Options:" \
|
"Options:" \
|
||||||
" --iterations overwrite n times (defauls to 3)" \
|
" --rounds <rounds> overwrite n times (defauls to 3)" \
|
||||||
" --zero overwrite with zeros to hide secure erase" \
|
" --zero overwrite with zeros obfuscating secure erase" \
|
||||||
" -h, --help display help for command"
|
" -h, --help display help for command"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
--iterations)
|
--rounds)
|
||||||
iterations=$2
|
rounds=$2
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -55,13 +55,12 @@ printf "$red%s$normal\n" "Secure erase USB flash drive? (y or n)? "
|
|||||||
|
|
||||||
read -r answer
|
read -r answer
|
||||||
if [ "$answer" = "y" ]; then
|
if [ "$answer" = "y" ]; then
|
||||||
array=($(seq 1 1 $iterations))
|
for round in $(seq 1 1 $rounds); do
|
||||||
for iteration in ${array[@]}; do
|
printf "%s\n" "Overwriting with random data… (round $round of $rounds)"
|
||||||
printf "%s\n" "Erasing… (iteration $iteration of $iterations)"
|
|
||||||
sudo dd bs=1M if=/dev/urandom of=$dev
|
sudo dd bs=1M if=/dev/urandom of=$dev
|
||||||
done
|
done
|
||||||
if [ "$zero" = true ]; then
|
if [ "$zero" = true ]; then
|
||||||
printf "%s\n" "Writing zeros…"
|
printf "%s\n" "Overwriting with zeros…"
|
||||||
sudo dd bs=1M if=/dev/zero of=$dev
|
sudo dd bs=1M if=/dev/zero of=$dev
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user