1
|
#!/bin/bash
|
2
|
|
3
|
DATUM="$(date +%d-%b-%Y-ore-%H-%M)"
|
4
|
|
5
|
|
6
|
if [ -e /root/.ssh/authorized_keys ];then
|
7
|
cp /root/.ssh/authorized_keys /root/.ssh/authorized_keys.BKP-$DATUM
|
8
|
fi
|
9
|
|
10
|
grep root@g450ddd /root/.ssh/authorized_keys >/dev/null
|
11
|
|
12
|
if [ $? -eq 0 ]; then
|
13
|
echo "authorized keys already there"
|
14
|
else
|
15
|
cat authorized_keys-da-APPENDARE-a-root-del-Fuss-Server >> /root/.ssh/authorized_keys
|
16
|
fi
|
17
|
|
18
|
cp -r CartellaPerClient-Via-Clonezilla.ssh /srv/clonezilla/.ssh
|
19
|
|
20
|
chown -R clonezilla. /srv/clonezilla/.ssh
|
21
|
|
22
|
chmod 400 /srv/clonezilla/.ssh/id_rsa*
|
23
|
|
24
|
cp -r clientScripts /srv/clonezilla
|
25
|
|
26
|
chmod -R 770 /srv/clonezilla/clientScripts
|
27
|
|
28
|
|
29
|
if [ -e /srv/tftp/pxelinux.cfg/default ];then
|
30
|
mv /srv/tftp/pxelinux.cfg/default /srv/tftp/pxelinux.cfg/default.BKP-$DATUM
|
31
|
fi
|
32
|
|
33
|
cp default /srv/tftp/pxelinux.cfg
|
34
|
|
35
|
if [ -e /srv/clonezilla/ListaPc.txt ];then
|
36
|
mv /srv/clonezilla/ListaPc.txt /srv/clonezilla/ListaPc.txt.BKP-$DATUM
|
37
|
fi
|
38
|
|
39
|
cp ListaPc.txt /srv/clonezilla
|
40
|
|
41
|
if [ -e /srv/clonezilla/script ];then
|
42
|
mv /srv/clonezilla/script /srv/clonezilla/script.BKP-$DATUM
|
43
|
fi
|
44
|
|
45
|
cp script /srv/clonezilla
|
46
|
|
47
|
chmod 770 /srv/clonezilla/script
|
48
|
|
49
|
chown -R clonezilla. /srv/clonezilla/*
|
50
|
|
51
|
exit 0
|