d7fdbd
#!/bin/bash
d7fdbd
d7fdbd
confdir=/etc/vsftpd
d7fdbd
unitdir=/usr/lib/systemd/system
d7fdbd
targetdir=$1/vsftpd.target.wants
d7fdbd
d7fdbd
mkdir -p ${targetdir}
d7fdbd
d7fdbd
for f in $(ls -1 ${confdir}/*.conf | awk -F "." '{print $1}' | awk -F "/" '{print $4}')
d7fdbd
do
d7fdbd
  echo "Generating systemd units for $f"
d7fdbd
  ln -s ${unitdir}/vsftpd\@.service ${targetdir}/vsftpd\@$f.service > /dev/null 2>&1
d7fdbd
done
d7fdbd
d7fdbd
exit 0