4 # Deploy fai configuration to faiserver,
5 # then start a virtual machine to test the config.
8 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
10 cd $
(dirname $
(readlink
-f "$BASH_SOURCE"))
12 ssh root@faiserver
rm -rf /srv
/fai
/config
13 scp
-r fai
/config root@faiserver
:/srv
/fai
14 # fai example pass: fai
15 #ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
17 # generating a hashed password:
18 # under debian, you can do
19 # echo "yoursecrectpassword" | mkpasswd -m sha-512 -s
20 # On arch, best seems to be copy your shadow file to a temp location,
21 # then passwd, get out the new pass, then copy the shadow file back.
23 if [[ -e /q
/root
/shadow
/standard
]]; then
24 # note, it would be best to have some kind of security on this file
25 ssh root@faiserver
tee -a /srv
/fai
/config
/class
/DEFAULT.var
<<EOF
26 ROOTPW='$(cat /q/root/shadow/standard)'
30 tpvar
="$(s cat /q/root/shadow/traci-simple)"
31 ssh root@faiserver
tee -a /srv
/fai
/config
/class
/tp.var
<<EOF
35 scp ~
/.ssh
/id_rsa.pub \
36 root@faiserver
:/srv
/fai
/config
/files
/home
/ian
/.ssh
/authorized_keys
/GRUB_PC
37 s scp
-r /q
/root
/luks
/q
/root
/shadow
/traci
{,-simple} \
38 root@faiserver
:/srv
/fai
/config
/distro-install-common
39 scp
/a
/bin
/devbyid root@faiserver
:/srv
/fai
/nfsroot
/usr
/local
/bin
40 ssh root@faiserver
chmod -R a
+rX
/srv
/fai
/config
/distro-install-common