#!/bin/bash
#Website: http://www.2dan.cc 
#IMPORTANT!!!Please Setting the following Values!

# START
Version=`cat /etc/issue | grep 'Ubuntu'`
IP=$(/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v 127.0.0.2|grep -v inet6|awk '{print $2}'|tr -d "addr:")
Web=www.2dan.cc
Email=551024@qq.com
time=$(date)

if [ -n "$Version" ]
	then
	#start install proftpd
	apt-get install -y proftpd
	sed -i s/"#DefaultRoot"/"DefaultRoot"/g /etc/proftpd/proftpd.conf
	/etc/init.d/proftpd restart
	clear
	read -p "Please enter your FTP Username: " ftpusername
	read -p "Please enter your FTP Password: " ftppassword
	sudo useradd $ftpusername
	touch /root/chpass.txt
	echo $ftpusername:$ftppassword >> /root/chpass.txt
	chpasswd < /root/chpass.txt
	rm -rf /root/chpass.txt
	mkdir -p /home/$ftpusername
	chmod -R 777 /home/$ftpusername/*
	clear
		echo -e "\033[40;32m================================================================= \033[0m"
		echo -e "\033[40;32m          Your FTP IP  $IP                                        \033[0m"
		echo -e "\033[40;32m      FTP Username: $ftpusername / Password: $ftppassword         \033[0m"
		echo -e "\033[40;32m      ftp://$ftpusername:$ftppassword@$IP/                        \033[0m"
		echo -e "\033[40;32m================================================================= \033[0m"
		echo -e "\033[40;32m                     This's a GOOD START                          \033[0m"
		echo -e "\033[40;32m                                                                  \033[0m"
		echo -e "\033[40;32m                     CHD HDC TTG HDR HDS                          \033[0m"
		echo -e "\033[40;32m                                                                  \033[0m"
		echo -e "\033[40;32m   Uploaded 1T >>>Uploaded 2T >>>Uploaded 10T >>>Uploaded 100T    \033[0m"
		echo -e "\033[40;32m                                                                  \033[0m"
		echo -e "\033[40;32m                         QQ 551024                                \033[0m"
		echo -e "\033[40;32m                                                                  \033[0m"
		echo -e "\033[40;32m                    WEB http://$Web                               \033[0m"
		echo -e "\033[40;32m================================================================= \033[0m"
else
	echo "Version is not Ubuntu !!!"
	echo "Sorry!!!!! Now Quit........................."
	echo "Shell Script Over Time: $time"
fi


