/[soft]/drakx/trunk/rescue/startssh
ViewVC logotype

Diff of /drakx/trunk/rescue/startssh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3080 by alien, Sat Feb 25 20:52:44 2012 UTC revision 3081 by alien, Sun Feb 26 17:10:20 2012 UTC
# Line 8  fi Line 8  fi
8    
9  # generate host keys  # generate host keys
10  mkdir -p /etc/dropbear  mkdir -p /etc/dropbear
11  [[ -f /etc/dropbear/dropbear_dss_host_key ]] || dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key >/dev/null || { echo "Can't generate dsa host key" >&2 ; exit 4 }  [[ -f /etc/dropbear/dropbear_dss_host_key ]] || dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key >/dev/null || { echo "Can't generate dsa host key" >&2 ; exit 4; }
12  [[ -f /etc/dropbear/dropbear_rsa_host_key ]] || dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key >/dev/null || { echo "Can't generate rsa host key" >&2 ; exit 3 }  [[ -f /etc/dropbear/dropbear_rsa_host_key ]] || dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key >/dev/null || { echo "Can't generate rsa host key" >&2 ; exit 3; }
13    
14  # set a password  # set a password
15  passwd=`genpasswd`  passwd=`genpasswd`
# Line 17  if (( $? != 0 )); then Line 17  if (( $? != 0 )); then
17          reset          reset
18          exit $?          exit $?
19  fi  fi
20  sed -E -i -e 's/^root:[^:]*:/root:'"$passwd"':/' /etc/passwd || { echo "Can't set password" >&2 ; exit 2 }  sed -E -i -e 's/^root:[^:]*:/root:'"${passwd//\//\\/}"':/' /etc/passwd || { echo "Can't set password" >&2 ; exit 2; }
21    
22  # test for /dev/pts  # test for /dev/pts
23  grep '^devpts /dev/pts devpts ' /proc/mounts >/dev/null 2>/dev/null || mount -t devpts devpts /dev/pts  grep '^devpts /dev/pts devpts ' /proc/mounts >/dev/null 2>/dev/null || mount -t devpts devpts /dev/pts
24    
25  echo ""  echo ""
26  echo -n "Starting ssh daemon... "  echo -n "Starting ssh daemon... "
27  dropbear -E 2>/var/log/dropbear.log && echo "OK" || { echo "Failed" ; exit 1 }  dropbear -E 2>/var/log/dropbear.log && echo "OK" || { echo "Failed" ; exit 1; }

Legend:
Removed from v.3080  
changed lines
  Added in v.3081

  ViewVC Help
Powered by ViewVC 1.1.30