wok rev 18289
knock: set default interface
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Aug 14 10:06:48 2015 +0200 (2015-08-14) |
parents | cf37d3c0b711 |
children | da4cdfed1366 |
files | knock/stuff/etc/init.d/knock syslinux/stuff/iso2exe/init syslinux/stuff/iso2exe/taziso |
line diff
1.1 --- a/knock/stuff/etc/init.d/knock Thu Aug 13 00:47:16 2015 +0300 1.2 +++ b/knock/stuff/etc/init.d/knock Fri Aug 14 10:06:48 2015 +0200 1.3 @@ -13,7 +13,8 @@ 1.4 DAEMON=/usr/sbin/knockd 1.5 OPTIONS=$KNOCK_OPTIONS 1.6 PIDFILE=/var/run/knockd.pid 1.7 -[ -n "$OPTIONS" ] || OPTIONS="-d" 1.8 +IFACE="$(route -n | awk '{ if ($1 == "0.0.0.0" && $3 == $1) print $8}')" 1.9 +[ -n "$OPTIONS" ] || OPTIONS="-d -i ${IFACE:-eth0}" 1.10 1.11 case "$1" in 1.12 start)
2.1 --- a/syslinux/stuff/iso2exe/init Thu Aug 13 00:47:16 2015 +0300 2.2 +++ b/syslinux/stuff/iso2exe/init Fri Aug 14 10:06:48 2015 +0200 2.3 @@ -975,13 +975,15 @@ 2.4 which $DIALOG 2> /dev/null || DIALOG=tinydialog 2.5 dmesg > /tmp/dmesg 2.6 2.7 +isotitle="$(basename $ISO) $(stat -c %y /cdrom/media/. | sed 's/ .*//'\ 2.8 + ) $(blkid /mnt/$ISO | sed 's/.*LABEL="\([^"]*\).*/\1/')" 2.9 while true; do 2.10 trap shell 2 2.11 keymap="$(cat /etc/keymap.conf 2> /dev/null)" 2.12 locale="$(sed '/^LANG=/!d;s/.*=//' /etc/locale.conf 2> /dev/null)" 2.13 cat > /tmp/dialog <<EOT 2.14 $DIALOG --clear \ 2.15 - --title " Welcome to Linux " \ 2.16 + --title " ${isotitle:-Welcome to Linux} " \ 2.17 --menu "" 23 70 17 \ 2.18 $(xfile tazkeymap "tazkeymap" "Select keyboard (${keymap:-none})") \ 2.19 $(xfile tazlocale "tazlocale" "Select locale (${locale:-none})") \
3.1 --- a/syslinux/stuff/iso2exe/taziso Thu Aug 13 00:47:16 2015 +0300 3.2 +++ b/syslinux/stuff/iso2exe/taziso Fri Aug 14 10:06:48 2015 +0200 3.3 @@ -1208,6 +1208,12 @@ 3.4 ${1:-exit} 3.5 } 3.6 3.7 +isotitle() 3.8 +{ 3.9 + echo "$(basename $ISO) $(stat -c %y $media/.|sed 's/ .*//') $(blkid \ 3.10 + $ISO | sed 's/.*LABEL="\([^"]*\).*/\1/')" 3.11 +} 3.12 + 3.13 ISO="${1:-/dev/null}" 3.14 [ -z "$(isiso 2> /dev/null)" ] && echo "Usage : $0 file.iso" && exit 1 3.15 media=/tmp/madia$$ 3.16 @@ -1226,6 +1232,7 @@ 3.17 shift 2 3.18 if [ -n "$(eval $(grep "\"$exe\"" $0 | sed \ 3.19 '/^\$/!d;s/.(\(.*\)[\t ]*".*"[\t ]*".*/\1/'))" ]; then 3.20 + isotitle 3.21 grep "\"$exe\"" $0 | sed '/^\$/!d;s/.*"[\t ]*"\(.*\)".*/\1/' 3.22 echo ---- 3.23 $exe "$@" 3.24 @@ -1236,7 +1243,7 @@ 3.25 while true; do 3.26 cat > /tmp/dialog$$ <<EOT 3.27 $DIALOG --clear \ 3.28 - --title " $(basename $ISO) $(stat -c %y $media/. | sed 's/ .*//') " \ 3.29 + --title " $(isotitle) " \ 3.30 --menu "" -2 70 0 \ 3.31 $(cdfile 'README*' "readme" "Show the README file") \ 3.32 $(gotisomd5 "isomd5" "Check the ISO image") \