diff options
author | toni <matzeton@googlemail.com> | 2016-07-06 00:03:17 +0200 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2016-07-06 00:03:17 +0200 |
commit | d99dfdd91015ebce71f5869e43710d40da8ab3a6 (patch) | |
tree | 3e5cb3f17196a2ab0444b4f22a8a6497dea6d019 /scripts/naskpass.pre | |
parent | 359e3ab083c40482f8bd677b95d331798dd8d41c (diff) | |
parent | 9824c70507fd02cb61f0d2ac9c982e955cd911bb (diff) |
Merge ssh://192.168.0.10:/root/naskpass into jessie
Diffstat (limited to 'scripts/naskpass.pre')
-rwxr-xr-x | scripts/naskpass.pre | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/scripts/naskpass.pre b/scripts/naskpass.pre index f5acd96..032cc49 100755 --- a/scripts/naskpass.pre +++ b/scripts/naskpass.pre @@ -1,12 +1,30 @@ #!/bin/sh +. /scripts/functions . /etc/naskpass.conf +if [ "x${PRINTK}" != "x" ] && [ -r ${PRINTK} ] && [ -w ${PRINTK} ]; then + cat ${PRINTK} >${OLDPRINTK} + echo "0 0 0 0" >${PRINTK} +fi +sleep 0.2 + echo -n 'waiting for ip ' CURWAIT=$MAXWAIT -if [ -x /sbin/dropbear ]; then +if [ -x /sbin/sshd ]; then + +if [ "x${NASK_DEV}" != "x" ] && [ "x${NASK_MAC}" != "x" ]; then + ifconfig ${NASK_DEV} hw ether ${NASK_MAC} +fi + +if [ "x${NASK_DEV}" != "x" ] && [ "x${NASK_IP}" != "x" ]; then + ifconfig ${NASK_DEV} ${NASK_IP} +else + configure_networking & +fi + while ! $(ifconfig -a | grep -qoE 'inet addr:'); do echo -n '.' if [ $CURWAIT -le 0 ]; then @@ -14,8 +32,9 @@ while ! $(ifconfig -a | grep -qoE 'inet addr:'); do break fi CURWAIT=$(expr $CURWAIT - 1) - sleep 1 + sleep 0.5 done echo +/sbin/sshd fi |