InstallWgetSsl
#!/bin/sh
# Installs wget-ssl on a GW2358-4 running DD-WRT v24-sp2 (12/14/11) std - build 18007.
# Recall, we have DD-WRT here, not OpenWrt.
# This script was written by Stephan Seidl in 2012, no copyright is claimed.
# It is offered as-is, without any warranty.
# This script is in the public domain; do with it what you wish.
unset LANG LC_ALL
LC_ALL=C
export LC_ALL
set -e
dir="/tmp/auxiliary-directory"
rm -fr "${dir}"
mkdir "${dir}"
cd "${dir}"
#wget 'http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/ldconfig_0.9.33.2-1_ixp4xx.ipk'
#wget 'http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/ldd_0.9.33.2-1_ixp4xx.ipk'
#wget 'http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/libopenssl_1.0.1c-1_ixp4xx.ipk'
#wget 'http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/wget_1.13.4-1_ixp4xx.ipk'
#wget 'http://downloads.openwrt.org/snapshots/trunk/ixp4xx/packages/zlib_1.2.7-1_ixp4xx.ipk'
wget 'http://www.stfmc.de/misc/voip/wget/ldconfig_0.9.33.2-1_ixp4xx.ipk'
wget 'http://www.stfmc.de/misc/voip/wget/ldd_0.9.33.2-1_ixp4xx.ipk'
wget 'http://www.stfmc.de/misc/voip/wget/libopenssl_1.0.1c-1_ixp4xx.ipk'
wget 'http://www.stfmc.de/misc/voip/wget/wget_1.13.4-1_ixp4xx.ipk'
wget 'http://www.stfmc.de/misc/voip/wget/zlib_1.2.7-1_ixp4xx.ipk'
echo "################################################################################"
gzip -dc ldconfig_0.9.33.2-1_ixp4xx.ipk > package.tar
rm ldconfig_0.9.33.2-1_ixp4xx.ipk
tar xf package.tar
tar xzf data.tar.gz
mv sbin/ldconfig .
chmod 755 ldconfig
rm -fr control.tar.gz data.tar.gz debian-binary package.tar sbin
gzip -dc ldd_0.9.33.2-1_ixp4xx.ipk > package.tar
rm ldd_0.9.33.2-1_ixp4xx.ipk
tar xf package.tar
tar xzf data.tar.gz
mv usr/bin/ldd .
chmod 755 ldd
rm -fr control.tar.gz data.tar.gz debian-binary package.tar usr
gzip -dc libopenssl_1.0.1c-1_ixp4xx.ipk > package.tar
rm libopenssl_1.0.1c-1_ixp4xx.ipk
tar xf package.tar
tar xzf data.tar.gz
mv usr/lib/libcrypto.so* .
mv usr/lib/libssl.so* .
chmod 755 libcrypto.so* libssl.so*
rm -fr control.tar.gz data.tar.gz debian-binary package.tar usr
gzip -dc wget_1.13.4-1_ixp4xx.ipk > package.tar
rm wget_1.13.4-1_ixp4xx.ipk
tar xf package.tar
tar xzf data.tar.gz
mv usr/bin/wget* .
chmod 755 wget*
rm -fr control.tar.gz data.tar.gz debian-binary package.tar usr
gzip -dc zlib_1.2.7-1_ixp4xx.ipk > package.tar
rm zlib_1.2.7-1_ixp4xx.ipk
tar xf package.tar
tar xzf data.tar.gz
mv usr/lib/libz.so* .
chmod 755 libz.so*
rm -fr control.tar.gz data.tar.gz debian-binary package.tar usr
mount -o rw,remount /jffs
test -d /jffs/etc || mkdir /jffs/etc
test -d /jffs/usr || mkdir /jffs/usr
test -d /jffs/usr/bin || mkdir /jffs/usr/bin
test -d /jffs/usr/lib || mkdir /jffs/usr/lib
chmod 755 /jffs/etc /jffs/usr /jffs/usr/bin /jffs/usr/lib
cp -p ldconfig /jffs/usr/bin
cp -p ldd /jffs/usr/bin
cp -p libcrypto.so.1.0.0 /jffs/usr/lib
cp -p libssl.so.1.0.0 /jffs/usr/lib
cp -p libz.so.1.2.7 /jffs/usr/lib
cp -p wget-ssl /jffs/usr/bin
cd /
rm -fr "${dir}"
( cd /jffs/usr/lib && rm -f libz.so.1 && ln -s libz.so.1.2.7 libz.so.1 )
txt=""
txt="${txt}#!/bin/sh;"
txt="${txt};"
txt="${txt}# Updates /etc/ld.so.cache such that imported shared libs become visible.;"
txt="${txt};"
txt="${txt}# This script was written by Stephan Seidl in 2012, no copyright is claimed.;"
txt="${txt}# It is offered as-is, without any warranty.;"
txt="${txt}# This script is in the public domain+ do with it what you wish.;"
txt="${txt};"
txt="${txt}unset LANG LC_ALL;"
txt="${txt}LC_ALL=C;"
txt="${txt}export LC_ALL;"
txt="${txt};"
txt="${txt}test -e /jffs/etc/ld.so.cache || exit 0;"
txt="${txt};"
txt="${txt}grep -q @ /etc/ld.so.cache @ /proc/mounts || mount -o bind /jffs/etc/ld.so.cache /etc/ld.so.cache;"
echo "${txt}" | tr '+@;' ';\042\012' > /jffs/usr/bin/UpdateLdSoCache
chmod 755 /jffs/usr/bin/UpdateLdSoCache
ldconfig -X -C /jffs/etc/ld.so.cache___
cp /jffs/etc/ld.so.cache___ /jffs/etc/ld.so.cache
rm /jffs/etc/ld.so.cache___
chmod 644 /jffs/etc/ld.so.cache
mount -o ro,remount /jffs
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
Stephan K.H. Seidl