This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
install.sh
52 lines (45 loc) · 1.58 KB
/
install.sh
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
#!/bin/sh
if [ -z $(nvram get help_enable) ] ; then
echo 'It works on Padavan firmware only, sorry. Exiting...'
exit 1
fi
dl () {
# $1 - URL to download
# $2 - place to store
# $3 - 'x' if should be executable
echo -n "Downloading $2... "
wget -q --no-check-certificate $1 -O $2
if [ $? -eq 0 ] ; then
echo 'success!'
else
echo 'failed!'
exit 1
fi
[ -z "$3" ] || chmod +x $2
}
cd /opt
if [ ! -e '/opt/bin/opkg' ] ; then
# Entware is not installed, install start scripts
mkdir -p /opt/etc/init.d
dl http://pkg.entware.net/binaries/mipsel/installer/rc.func /opt/etc/init.d/rc.func
dl http://pkg.entware.net/binaries/mipsel/installer/rc.unslung /opt/etc/init.d/rc.unslung x
sed -i 's|/opt/bin/find|find|g' /opt/etc/init.d/rc.unslung
# This prevents f\w to install Entware
mkdir -p /opt/bin
touch /opt/bin/opkg
fi
dl https://raw.githubusercontent.com/DontBeAPadavan/chroot-debian/master/opt/etc/init.d/S99debian /opt/etc/init.d/S99debian x
dl http://files.ryzhov-al.ru/Routers/chroot-debian/debian_clean.tgz /opt/debian_clean.tgz
echo -n 'Unpacking Debian environment... '
tar -xzf debian_clean.tgz
if [ $? -eq 0 ] ; then
echo 'success!'
else
echo 'failed!'
exit 1
fi
rm debian_clean.tgz
echo 'ssh' > /opt/debian/chroot-services.list
echo -n 'The Debian services from /opt/debian/chroot-services.list will be started automatically at boot time. You may log into Debian environment via SSH root:[email protected]:65022. Do you wish to start it now? [y/n]: '
read yn
[ "$yn" = "y" ] && /opt/etc/init.d/S99debian start