blob: c61de42e68af6da38ccb62cc9b97dee7d058bc2b [file] [log] [blame]
Patrick Jacquesdc808ff2010-08-28 05:25:45 -07001#!/system/bin/sh
2#
3# Generate keys for the Dropbear SSH server
4# Steve Kondik (cyanogen)
5#
6
7DROPBEAR_HOME=/data/dropbear
8DROPBEARKEY=/system/xbin/dropbearkey
9
10if [ ! -d $DROPBEAR_HOME ] || [ ! -f $DROPBEAR_HOME/dropbear_rsa_host_key ] || [ ! -f $DROPBEAR_HOME/dropbear_dsa_host_key ];
11then
12 if [ ! -d $DROPBEAR_HOME ];
13 then
14 mkdir /data/dropbear;
15 chmod 750 /data/dropbear
16 fi
17 for k in dss rsa;
18 do
19 if [ ! -e $DROPBEAR_HOME/dropbear_${k}_host_key ];
20 then
21 $DROPBEARKEY -t $k -f $DROPBEAR_HOME/dropbear_${k}_host_key;
22 chmod 640 $DROPBEAR_HOME/dropbear_${k}_host_key;
23 fi
24 done
25fi