Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (55 sloc) 1.56 KB
#!/opt/bin/sh
export TZ=`cat /etc/TZ | tail -n 1`
export PATH=/opt/sbin:/opt/bin:$PATH
unset LD_LIBRARY_PATH
unset LD_PRELOAD
URL=http://pkg.entware-keenetic.ru/binaries/keenle.old/installer
case $(mount | grep 'on /opt' | cut -d ' ' -f 5) in
ext*)
echo 'Partition is OK.'
;;
*ntfs*)
echo 'NTFS partition! owner:group attributes may not be supported.'
echo 'Please, use ext2/ext3 if something goes wrong.'
;;
*hfs*)
echo 'HFS partition is not tested.'
echo 'Please, use ext2/ext3 if something goes wrong.'
;;
*)
echo 'Please use ext2/ext3 formatted storage. Aborting...'
exit 1
;;
esac
echo '[1/4] Starting Entware-ng deployment...'
dots.sh &
# This is for opkg only. The other folders will be created from zyx-opt package
for folder in lib/opkg tmp var/lock; do
mkdir -p /opt/$folder
done
# Fix for multiuser environment
chmod 777 /opt/tmp
wget $URL/opkg -O /opt/bin/opkg
chmod +x /opt/bin/opkg
wget $URL/opkg.conf -O /opt/etc/opkg.conf
echo '[2/4] Basic packages installation...'
opkg update
opkg install opt-ndmsv2 busybox-zyx dropbear
ldconfig > /dev/null 2>&1
echo '[3/4] Generating SSH keys...'
dbkey () {
# $1 is a key type [rsa|ecdsa]
rm /opt/etc/dropbear/dropbear_${1}_host_key
dropbearkey -t $1 -f /opt/etc/dropbear/dropbear_${1}_host_key > /dev/null &
while [ ! -z "$(pidof dropbearkey)" ] ; do
sleep 2
echo -n '.'
done
echo 'done.'
}
dbkey rsa
dbkey ecdsa
echo '[4/4] Entware-ng installed! Starting dropbear...'
dropbear -p 22 -a
echo 'Log on at root:zyxel@my.keenetic.net to start new SSH session.'
rm $0