fix: now deals with the correct path for the old ssh accounts

This commit is contained in:
silver 2023-08-24 18:54:22 +01:00
parent 32d693fa8c
commit ce471ad39a
6 changed files with 23 additions and 9 deletions

18
scripts/grab_keys.sh Normal file
View file

@ -0,0 +1,18 @@
#!/bin/bash
from="./skynet_old/home"
to="./home_tmp"
find $from -maxdepth 3 -name "authorized_keys" -type f > tmp2
while IFS= read -r path_old
do
echo "From: $path_old"
path_new="${path_old/"$from"/"$to"}"
echo "To: $path_new"
path_dir="${path_new/authorized_keys/}"
mkdir -p "$path_dir"
cp "$path_old" "$path_new"
done < tmp2
rm tmp2
chmod -R skynet_ldap_backend $to