File: kfreebsd-ltsp-update-sshkeys

package info (click to toggle)
ltsp 5.5.4-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,440 kB
  • ctags: 359
  • sloc: sh: 5,106; ansic: 1,590; perl: 280; python: 197; makefile: 171; lex: 152; yacc: 59
file content (23 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## kfreebsd-ltsp-update-sshkeys.dpatch by  <Vagrant Cascadian <vagrant@freegeek.org>>
##
## DP: patch to support ifconfig in Debian GNU/kFreeBSD as an alternative ip
## DP: command from iproute.

Index: ltsp-5.2.2/server/ltsp-update-sshkeys
===================================================================
--- ltsp-5.2.2.orig/server/ltsp-update-sshkeys	2010-07-05 12:46:38.000000000 -0700
+++ ltsp-5.2.2/server/ltsp-update-sshkeys	2010-07-05 12:46:48.000000000 -0700
@@ -84,7 +84,12 @@
 
 if [ -z "$*" ]; then
     HOSTNAME=$(hostname)
-    IPS=$(/sbin/ip -o -f inet addr show | sed -e 's,.* \(.*\)/.*,\1,' | grep -v '^127')
+    if [ -x /sbin/ip ]; then
+        IPS=$(/sbin/ip -o -f inet addr show | sed -e 's,.* \(.*\)/.*,\1,' | grep -v '^127')
+    elif [ -x /sbin/ifconfig ]; then
+        # this assumes freebsd-net-tools on a Debian GNU/kFreeBSD system
+        IPS=$(/sbin/ifconfig  | awk '/inet [1-9]/{print $2}' | egrep -v ^127)
+    fi
     NAMES="${HOSTNAME} ${IPS}"
     THIS_SERVER=1
 else