File: lessdisks-keycopy

package info (click to toggle)
lessdisks 0.5.3cvs.20040906-16
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,480 kB
  • ctags: 271
  • sloc: sh: 3,058; makefile: 92
file content (38 lines) | stat: -rwxr-xr-x 823 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

# copies host keys into known hosts files for lessdisks terminals

# copyright 2004 vagrant@freegeek.org, distributed under the terms of the
# GNU General Public License version 2 or any later version.

if [ -r /etc/lessdisks-install.conf ]; then
  . /etc/lessdisks-install.conf
fi 

if [ -r /etc/lessdisks/server.config ]; then
  . /etc/lessdisks/server.config
fi

if [ -z "$lessdisks_path" ]; then
  echo "lessdisks_path not set, exiting..."
  exit 2
fi

tempfile=$(tempfile)

if [ -z "$tempfile" ]; then
  echo "no tempfile set... arg!"
  exit 1
fi

for name in xapp disk $(hostname); do
  for type in rsa dsa; do
    echo "$name" $(cat /etc/ssh/ssh_host_$type\_key.pub) >> $tempfile
  done
done

mkdir -p $lessdisks_path/root/.ssh
cd $lessdisks_path/root/.ssh
chmod og-rwx .
cp $tempfile known_hosts
exit $?