wok-tiny view fbvnc-ssh/receipt @ rev 126

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