mirror of
https://github.com/hak5/nano-tetra-modules.git
synced 2025-10-29 16:58:09 +00:00
Add modules to repository
This commit is contained in:
53
Papers/includes/scripts/unpackKeyArchive.sh
Executable file
53
Papers/includes/scripts/unpackKeyArchive.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Author: sud0nick
|
||||
# Date: Sept 2016
|
||||
|
||||
help() {
|
||||
echo "Usage: ./unpackKeyArchive.sh -f <fileName>";
|
||||
echo '';
|
||||
echo 'Parameters:';
|
||||
echo '';
|
||||
echo -e '\t-f:\tFile name without extension';
|
||||
echo '';
|
||||
}
|
||||
|
||||
if [ "$#" -lt 2 ]; then
|
||||
help;
|
||||
exit;
|
||||
fi
|
||||
|
||||
# Define and clear out the download directory
|
||||
DL_DIR="/pineapple/modules/Papers/includes/upload/";
|
||||
|
||||
FILE='';
|
||||
export IFS=" ";
|
||||
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
|
||||
if [[ "$1" == "-f" ]]; then
|
||||
FILE="$DL_DIR$2"
|
||||
fi
|
||||
|
||||
shift
|
||||
done;
|
||||
|
||||
output=$(unzip $FILE.zip -d $DL_DIR);
|
||||
|
||||
# If the archive contained a .pub these
|
||||
# keys are destined for the SSH directory
|
||||
if [[ $output == *".pub"* ]]; then
|
||||
mv $FILE.pub /pineapple/modules/Papers/includes/ssh/
|
||||
mv $FILE.pem /pineapple/modules/Papers/includes/ssh/
|
||||
fi
|
||||
|
||||
# If the archive contained a .cer these
|
||||
# keys are destined for the SSL directory
|
||||
if [[ $output == *".cer"* ]]; then
|
||||
mv $FILE.cer /pineapple/modules/Papers/includes/ssl/
|
||||
mv $FILE.pem /pineapple/modules/Papers/includes/ssl/
|
||||
fi
|
||||
|
||||
# Clear the download directory
|
||||
rm -rf $DL_DIR*
|
||||
Reference in New Issue
Block a user