#!/bin/bash ######系統配合 #下載ISO檔 #https://ftp.ubuntu-tw.org/ubuntu-releases/26.04.1/ 安裝 ######鄭亮星 jls@mail.jls.idv.tw , jls550225@gmail.com , jls@acfs.tw ##設定 proftpd ETH0=$(ls /proc/net/dev_snmp6 |awk '{ print $1 }' |sed -n '1p') IP=$(ifconfig $ETH0 |grep 'inet ' |awk '{print $2}') HOSTNAME=$(/bin/hostname) DATE=$(date "+%Y%m%d%H") sync cp -arf /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf-$DATE sync echo "/bin/false" >> /etc/shells find /etc/proftpd/proftpd.conf -type f -exec perl -i -pe s/"Debian"/"$HOSTNAME"/g {} \; find /etc/proftpd/proftpd.conf -type f -exec perl -i -pe s/"# DefaultRoot~"/"DefaultRoot ~"/g {} \; find /etc/proftpd/proftpd.conf -type f -exec perl -i -pe s/"# PassivePorts"/"PassivePorts"/g {} \; systemctl enable proftpd.service systemctl restart proftpd.service