find .txt.free and rename

This commit is contained in:
mischa 2022-07-15 16:24:39 +02:00
parent 3e3fb0a5c7
commit 03a28f543b
1 changed files with 7 additions and 2 deletions

View File

@ -26,8 +26,13 @@ if [[ -z ${1} ]]; then
exit 1 exit 1
fi fi
if [[ ! -f "${VMS}/${1}.txt" ]]; then if [[ ! -f "${VMS}/${1}.txt" ]]; then
echo "unable to find ${VMS}/${1}" echo "unable to find ${VMS}/${1}.txt"
if [[ -f "${VMS}/${1}.txt.free" ]]; then
echo "found ${VMS}/${1}.txt.free"
mv ${VMS}/${1}.txt.free ${VMS}/${1}.txt
else
exit 1 exit 1
fi
else else
chown mischa ${VMS}/${1}.txt chown mischa ${VMS}/${1}.txt
chmod 600 ${VMS}/${1}.txt chmod 600 ${VMS}/${1}.txt