Adds scripts

This commit is contained in:
Matheus Albino Brunhara
2024-11-19 08:57:18 -03:00
parent baaa076796
commit 3663cd0d05
2 changed files with 18 additions and 0 deletions

15
scripts/shell/format-xml.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/env bash
# Create a temporary file
temp_file=$(mktemp)
# Run xmllint and output to the temporary file
if xmllint --format "$1" >"$temp_file"; then
# If successful, replace the original file with the formatted file
mv "$temp_file" "$1"
else
# If unsuccessful, remove the temporary file
rm "$temp_file"
echo "Formatting failed."
exit 1
fi

3
scripts/shell/ports-in-use.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
sudo lsof -i -P -n | grep LISTEN