User creation scripts for aws servers
This commit is contained in:
19
user_zip.sh
Executable file
19
user_zip.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
root_folder=$(pwd)'/';
|
||||
|
||||
if [ ! command -v zip &> /dev/null ]; then
|
||||
echo "Missing zip application, aborting";
|
||||
exit;
|
||||
fi;
|
||||
|
||||
# arg 1 must be valid path to where we store the zip file
|
||||
if [ ! -d "${1}" ]; then
|
||||
echo "${1} is not a valid path";
|
||||
exit;
|
||||
fi;
|
||||
|
||||
# zip key folder, user list, user password into users.zip
|
||||
echo "Zipping data to: ${1}/users.zip"
|
||||
$(cd "${root_folder}"; zip -FSr "${1}/users.zip" "user_list.txt" "user_password.txt" "ssh-keygen/");
|
||||
echo "Data zipped";
|
||||
Reference in New Issue
Block a user