#!/bin/bash

myNic="$(ls /sys/class/net/ -1 | grep -v lo | grep -v wlan)"

if [ -e /root/reboot ];then
    rm /root/reboot
    touch /root/join
    shutdown -r now
fi

if [ -e /root/join ];then
    dhclient $myNic
    screen -d -m -S XY
    screen -S XY -X stuff "fuss-client -av && rm /root/join ; reboot\n"
else
    rm /etc/rc.local
    rm /root/clientScript
    rm -fr /root/.ssh
        
fi





