Project

General

Profile

Download (641 Bytes) Statistics
| Branch: | Tag: | Revision:

fuss-fucc / clientScripts / clientScript @ d803d4cf

1 e2ac9a14 Paolo Dongilli
#!/bin/bash
2
3
myNic="$(ls /sys/class/net/ -1 | grep -v lo | grep -v wlan)"
4
5
if [ -e /root/reboot ];then
6
    rm /root/reboot
7
    touch /root/join
8
    shutdown -r now
9
fi
10
11 a1471122 Donato Florio
12
if [ -e /root/cluster ];then
13
    clusterJoin="$(cat /root/cluster)"
14
fi
15
16
17 e2ac9a14 Paolo Dongilli
if [ -e /root/join ];then
18 a1471122 Donato Florio
# Following dhclient was necessary inside a virtual(box) environment. Not sure if needed anymore. In case it can be removed or commented.    
19 e2ac9a14 Paolo Dongilli
    dhclient $myNic
20
    screen -d -m -S XY
21 a1471122 Donato Florio
    screen -S XY -X stuff "fuss-client -av $clusterJoin && rm /root/join ; reboot\n"
22 e2ac9a14 Paolo Dongilli
else
23
    rm /etc/rc.local
24
    rm /root/clientScript
25
    rm -fr /root/.ssh
26 a1471122 Donato Florio
    rm /root/cluster
27 e2ac9a14 Paolo Dongilli
fi
28
29
30
31