-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoinstall
More file actions
65 lines (55 loc) · 1.56 KB
/
doinstall
File metadata and controls
65 lines (55 loc) · 1.56 KB
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
#!/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