#!/bin/bash

echo "31move-fonts start"
fifoName="31move-fonts-fifo"
if [ ! -e ${fifoName} ]; then
    mkfifo -m 666 ${fifoName}
fi
exec 6<>${fifoName}
echo "20" >&6

fontsPathList=("/usr/share/fonts/" "/usr/local/share/fonts/")
for everyPath in ${fontsPathList[@]};do
    if [ -d /fs.old$everyPath ];then
        if [ ! -e $everyPath ];then
            mkdir -p $everyPath 
        fi
        cp -rp --no-clobber /fs.old$everyPath* $everyPath
    fi
done


echo "100" >&6
exec 6<&-
rm -f ${fifoName}
echo "31move-fonts success"
