mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Cleaned up final output
This commit is contained in:
parent
95d5d05075
commit
e9e9dd9dbb
@ -13,10 +13,15 @@ read -r -a delete_these_lines <<< "$deduped_args"
|
||||
lines_to_delete=""
|
||||
for var in "${delete_these_lines[@]}"; do
|
||||
if [[ "$var" -gt "$lines_in_known_hosts" ]]; then
|
||||
echo "$var isnt valid line in $lines_in_known_hosts line $known_hosts_path"
|
||||
echo "$var is invalid line in $lines_in_known_hosts line $known_hosts_path"
|
||||
else
|
||||
lines_to_delete+="${var}d;"
|
||||
fi
|
||||
done
|
||||
sed -i "$lines_to_delete" "$known_hosts_path"
|
||||
echo "Deleted lines $(echo $(echo $lines_to_delete | sed 's/d;/, /g') | sed 's/.$//' )"
|
||||
if [[ -z "$lines_to_delete" ]]; then
|
||||
echo "All arguments passed were invalid lines in $known_hosts_path"
|
||||
elif [[ -n "$string" ]]; then
|
||||
sed -i "$lines_to_delete" "$known_hosts_path"
|
||||
echo "Deleted lines $(echo $(echo $lines_to_delete | sed 's/d;/, /g') | sed 's/.$//' )"
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user