Commit b08cb508 authored by Girish Ramakrishnan's avatar Girish Ramakrishnan

Fix key migration

parent 89b3db92
......@@ -24,12 +24,12 @@ if [ ! -d /app/data/keys ]; then
/app/code/easyrsa/pkitool --server cloudron # server key
echo "==> Migrate keys to new layout"
for file in `find /app/data/key/*:* -maxdepth 0 -type f -printf "%f\n"`; do
echo "==> moving $file"
username=$(cat $file | cut -d ":" -f 1)
devicename=$(cat $file | cut -d ":" -f 2)
for file in `find /app/data/keys/*:* -maxdepth 0 -type f -printf "%f\n"`; do
username=$(echo $file | cut -d ":" -f 1)
devicename=$(echo $file | cut -d ":" -f 2) # with the file extension
echo "==> moving $file (username: $username devicename: $devicename"
mkdir -p /app/data/keys/${username}
mv $file /app/data/keys/${username}/${devicename}
mv /app/data/keys/$file /app/data/keys/${username}/${devicename}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment