vsftpd/vsftpd_conf_migrate.sh
Ondřej Lysoněk 81c7e83b2e Fix filename expansion in vsftpd_conf_migrate.sh ... again
We need to run 'shopt -s nullglob', otherwise the glob pattern
will expand to itself if no matching files exist.
2018-06-01 22:38:48 +02:00

14 lines
348 B
Bash
Executable File

#!/bin/bash
#move old config files and symlink them
#shipped with vsftpd-2.0.1-6
shopt -s nullglob
PREFIX="vsftpd"
for file in /etc/${PREFIX}.*; do
if [ ! -L $file ]; then
new=`echo $file | sed s/${PREFIX}\./${PREFIX}\\\\//g | sed s/\.rpmsave//g`
mv -f ${file} ${new}
ln -s ${new} ${file}
echo $file moved to $new
fi
done