1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# name,url,username,password,note
mapfile -t names < <(cat Google_Passwords.csv | awk -F ',' '{print $1}')
mapfile -t urls < <(cat Google_Passwords.csv | awk -F ',' '{print $2}')
mapfile -t usernames < <(cat Google_Passwords.csv | awk -F ',' '{print $3}')
mapfile -t passwords < <(cat Google_Passwords.csv | awk -F ',' '{print $4}')
# name_num="${#names[@]}"
# echo "$name_num"
if [ ! -d "temp" ]; then
mkdir -p temp
fi
cd temp
mkdir -p ${names[@]}
var1=$(pwd)
for ((i=0; i < ${#names[@]}; i++)) ; do
# echo "${usernames[${i}]}"
cd "${names[${i}]}"
if [ "${usernames[${i}]}" == "" ]; then
usernames[${i}]="passwd${i}"
fi
# echo "${usernames[${i}]}"
echo "${passwords[${i}]}" > "${usernames[${i}]}"
echo "login: ${usernames[${i}]}" >> "${usernames[${i}]}"
echo "url: ${urls[${i}]}" >> "${usernames[${i}]}"
gpg --yes -r ynpass -e "${usernames[${i}]}"
rm "${usernames[${i}]}"
cd $var1
done
|