#!/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin random() { tr proxy.txt < /etc/rc.d/rc.local #!/bin/bash touch /var/lock/subsys/local EOF echo "installing apps" yum -y install wget gcc net-tools bsdtar zip >/dev/null install_3proxy echo "working folder = /home/cloudfly" WORKDIR="/home/cloudfly" WORKDATA="${WORKDIR}/data.txt" mkdir $WORKDIR && cd $_ IP4=$(curl -4 -s icanhazip.com) IP6=$(curl -6 -s icanhazip.com | cut -f1-4 -d':') echo "Internal ip = ${IP4}. Exteranl sub for ip6 = ${IP6}" while :; do read -p "Enter FIRST_PORT between 33000 and 63000: " FIRST_PORT [[ $FIRST_PORT =~ ^[0-9]+$ ]] || { echo "Enter a valid number"; continue; } if ((FIRST_PORT >= 33000 && FIRST_PORT <= 63000)); then echo "OK! Valid number" break else echo "Number out of range, try again" fi done LAST_PORT=$(($FIRST_PORT + 750)) echo "LAST_PORT is $LAST_PORT. Continue..." gen_data >$WORKDIR/data.txt gen_iptables >$WORKDIR/boot_iptables.sh gen_ifconfig >$WORKDIR/boot_ifconfig.sh chmod +x boot_*.sh /etc/rc.local #gen_3proxy >/usr/local/etc/3proxy/3proxy.cfg cat >>/etc/rc.local <