wok-tiny annotate fbvnc-ssh/receipt @ rev 110

Add modules ide & tlan
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Mar 09 21:30:10 2016 +0100 (2016-03-09)
parents 0d8ef9102fc0
children 93fed11eae87
rev   line source
pascal@67 1 # SliTaz package receipt.
pascal@67 2
pascal@67 3 PACKAGE="fbvnc-ssh"
pascal@67 4 VERSION="1.0"
pascal@110 5 CATEGORY="meta"
pascal@110 6 GROUP="network"
pascal@67 7 SHORT_DESC="VNC client in frame buffer within a SSH tunnel."
pascal@67 8 MAINTAINER="pascal.bellard@slitaz.org"
pascal@91 9 LICENSE="BSD"
pascal@67 10 WEB_SITE="http://tiny.slitaz.org/"
pascal@67 11 DEPENDS="base-tiny fbvnc dropbear"
pascal@67 12
pascal@67 13 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@67 14 genpkg_rules()
pascal@67 15 {
pascal@67 16 mkdir -p $fs/usr/bin
pascal@67 17 }
pascal@67 18
pascal@67 19 config_form()
pascal@67 20 {
pascal@67 21 [ "$VNCONLY" == "no" ] || VNCONLY=yes
pascal@67 22 [ -n "$VNCUSER" ] || VNCUSER=tux
pascal@67 23 cat <<EOT
pascal@67 24 <table>
pascal@67 25 <tr>
pascal@67 26 <td>SSH user for the VNC server</td>
pascal@67 27 <td><input type="text" name="VNCUSER" value="$VNCUSER"></td>
pascal@67 28 </tr>
pascal@67 29 <tr>
pascal@67 30 <td>Remove virtual consoles ?</td>
pascal@67 31 <td>
pascal@67 32 <input type="radio" name="VNCONLY" $([ "$VNCONLY" == "no" ] && echo "checked=checked ")value="no"> keep virtual consoles 3 to 6
pascal@67 33 <input type="radio" name="VNCONLY" $([ "$VNCONLY" == "yes" ] && echo "checked=checked ")value="yes"> keep VNC console only
pascal@67 34 </td>
pascal@67 35 </tr>
pascal@67 36 </table>
pascal@67 37 <p>
pascal@110 38 <input type="checkbox" name="ASKFIRST" checked=checked />
pascal@110 39 Confirm VNC console launch (spare some memory)
pascal@110 40 </p>
pascal@110 41 <p>
pascal@68 42 You should add the public key in <b>\$HOME/.ssh/authorized_keys</b> of the VNC/SSH server.
pascal@67 43 </p>
pascal@67 44 <p>
pascal@67 45 You can get it on the client (from configuration files) with:
pascal@67 46 </p>
pascal@67 47 <pre>
pascal@67 48 # dropbearkey -y -f /etc/dropbear/dropbear_dss_host_key | grep ^ssh
pascal@67 49 </pre>
pascal@67 50 or
pascal@67 51 <pre>
pascal@67 52 # dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key | grep ^ssh
pascal@67 53 </pre>
pascal@67 54 EOT
pascal@67 55 }
pascal@67 56
pascal@67 57 post_install()
pascal@67 58 {
pascal@110 59 respawn=respawn
pascal@110 60 [ "$ASKFIRST" ] && respawn=askfirst
pascal@67 61 sed -i 's/\(fbvnc -bpp [0-9]*\) \([^|]*\)/\1 127.0.0.1 5900/;/kill -1 1/d' $1/etc/init.d/local.sh
pascal@67 62 cat >> $1/etc/init.d/local.sh <<EOT
pascal@67 63
pascal@67 64 # From fbvnc-ssh
pascal@67 65 EOT
pascal@67 66 [ "$VNCONLY" == "yes" ] && cat >> $1/etc/init.d/local.sh <<EOT
pascal@110 67 sed -i '/^tty[2-9]:.*/d' /etc/inittab
pascal@67 68 EOT
pascal@67 69 cat >> $1/etc/init.d/local.sh <<EOT
pascal@67 70 grep -qs fbvnc /etc/inittab &&
pascal@110 71 echo "vnc::$respawn:/usr/bin/ssh -i /etc/dropbear/dropbear_dss_host_key -i /etc/dropbear/dropbear_rsa_host_key -y -N -L 5900:127.0.0.1:\$VNCPORT $VNCUSER@\$VNCSERVER" >> /etc/inittab
pascal@67 72 kill -1 1
pascal@67 73 EOT
pascal@67 74 }