[DO-1390] Add critical services, default VM, network and hardware (!18)

DO-1390

Co-authored-by: denis.patrakeev <denis.patrakeev@avroid.tech>
Reviewed-on: https://git.avroid.tech/DevOps/secrets/pulls/18
This commit is contained in:
Denis Patrakeev
2024-12-28 19:55:11 +03:00
parent 7a8a4bb823
commit 0dd219a068
60 changed files with 3764 additions and 29 deletions

View File

@@ -1,9 +1,9 @@
#!/bin/bash
set -euo pipefail
SCRIPT_PATH=$(dirname "$(readlink -f "$0")";)
SCRIPT_PATH=$(dirname "$(readlink -f "$0")")
function help {
echo "
echo "
gpg-tool.sh [args] file
Commands:
@@ -29,22 +29,20 @@ function decrypt {
function view {
FILE="$1"
gpg --decrypt "$SCRIPT_PATH"/"$FILE" 2>/dev/null
gpg --decrypt "$SCRIPT_PATH"/"$FILE" 2> /dev/null
}
function import_keys {
for i in ls "$SCRIPT_PATH"/keys/*.pub
do
for i in ls "$SCRIPT_PATH"/keys/*.pub; do
gpg --import "$i" 2>&1 | head -1 | awk '{print $3}' | sed 's/.$//' > /dev/null
done
echo 'All keys have been imported'
}
function get_recipients {
for i in "$SCRIPT_PATH"/keys/*.pub
do
for i in "$SCRIPT_PATH"/keys/*.pub; do
allKeys+="--recipient $(gpg --import "$i" 2>&1 | head -1 | awk '{print $3}' | sed 's/.$//') "
done
done
echo "$allKeys"
}
@@ -60,29 +58,29 @@ if [ $# = 0 ]; then
fi
case $1 in
-i| --import_keys)
import_keys && exit 0
;;
-i | --import_keys)
import_keys && exit 0
;;
-d| --decrypt)
decrypt "$2"
;;
-d | --decrypt)
decrypt "$2"
;;
-e| --encrypt)
encrypt "$2"
;;
-e | --encrypt)
encrypt "$2"
;;
-v| --view)
view "$2"
;;
-v | --view)
view "$2"
;;
-h| --help)
help
exit
;;
-h | --help)
help
exit
;;
*)
help
exit 0
;;
esac
*)
help
exit 0
;;
esac