/usr/share/tcos/hooks-addons/60italc is in initramfs-tools-tcos 0.89.93ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | # hooks addon to use iTALC vnc MasterEye
# need italc-client
# also copy xmessage instead of messageviewer
# that don't need qt libs
if [ ! ${TCOS_ITALC} ]; then
_verbose "(60italc) TCOS_ITALC disabled"
else
if [ -x /usr/bin/ica ]; then
# new italc 1.0.0 version
stat_before
if [ ! -d /etc/italc/keys/public ]; then
echo ""
echo "ERROR:"
echo " You must create public/private iTALC keys:"
echo ""
echo " # ica -role teacher -createkeypair "
echo ""
else
cpifexists /usr/bin/ica /usr/bin/
mkdir -p $DESTDIR/etc/italc/keys
cp -ra /etc/italc/keys/public $DESTDIR/etc/italc/keys/
cat <<EOF > $DESTDIR/sbin/startica
#!/bin/sh
# kill
killall ica >/dev/null 2>&1
sleep 4
export DISPLAY=:0
while [ 1 ]; do
killall ica
ica >/dev/null 2>&1
done
EOF
chmod +x $DESTDIR/sbin/startica
fi
stat_after "iTalc 1.0.0"
elif [ -x /usr/bin/ivs ]; then
stat_before
cpifexists /usr/bin/ivs /usr/bin/
cpifexists /usr/bin/demoviewer /usr/bin/
cpifexists /usr/bin/screenlocker /usr/bin/
#cpifexists /usr/bin/messageviewer /usr/bin/
# messageviewer need qt libs
# ugly wrapper less ram
cpifexists /usr/bin/xmessage /usr/bin/
# overwrite, not link
rm $DESTDIR/usr/bin/xmessage
cp $(pathof xmessage) $DESTDIR/usr/bin/
mv $DESTDIR/usr/bin/xmessage $DESTDIR/usr/bin/messageviewer
if [ ${TCOS_ADMIN_USER} ]; then
# search public italc key
if [ ! -f /etc/italc-client/public-keys/${TCOS_ADMIN_USER}.public ]; then
# try to find in $HOME dir
if [ "${TCOS_ADMIN_USER}" = "root" ]; then
key=/root/.italc/id_rsa.public
else
home=$(getent passwd | grep "^${TCOS_ADMIN_USER}:" | awk -F":" '{print $6}')
key=${home}/.italc/id_rsa.public
fi
else
key=/etc/italc-client/public-keys/${TCOS_ADMIN_USER}.public
fi
if [ ! -f ${key} ]; then
_echo "WARNING:"
_echo " ${key} not found"
_echo " You can generate running italc as ${TCOS_ADMIN_USER} for first time"
_echo " or running italc-keygen"
else
mkdir -p $DESTDIR/etc/italc-client/public-keys/
cp ${key} $DESTDIR/etc/italc-client/public-keys/ 2>&1 > /dev/null
mv $DESTDIR/etc/italc-client/public-keys/id_rsa.public $DESTDIR/etc/italc-client/public-keys/${TCOS_ADMIN_USER}.public 2>&1 > /dev/null
cp $DESTDIR/etc/italc-client/public-keys/${TCOS_ADMIN_USER}.public $DESTDIR/etc/italc-client/public-keys/root.public 2>&1 > /dev/null
fi
else
_echo "WARNING: Unknow TCOS_ADMIN_USER, iTALC need public user key to allow connections"
_echo " Please fill TCOS_ADMIN_USER value"
fi
cat <<EOF > $DESTDIR/sbin/startivs
#!/bin/sh
# kill and wait until Xorg is started
killall ivs >/dev/null 2>&1
sleep 1
DISPLAY=:0 ivs -o /tmp/ivs.log -noshm -forever -shared
#(start again if italc kill it ??)
#while [ 1 ] ; do
# killall -9 ivs >/dev/null 2>&1
# sleep 1
# DISPLAY=:0 ivs -o /tmp/ivs.log -noshm -forever -shared
# sleep 2
#done
exit 0
EOF
chmod +x $DESTDIR/sbin/startivs
stat_after "iTALC"
else
echo "WARNING:"
echo ""
echo "italc-client not found, install italc-client or disable TCOS_ITALC."
echo " => # apt-get install italc-client"
echo ""
fi
fi #end of TCOS_ITALC
|