Update installentware.sh
Revert to original
This commit is contained in:
@@ -17,58 +17,58 @@ LOADER=ld-linux.so.3
|
|||||||
GLIBC=2.27
|
GLIBC=2.27
|
||||||
|
|
||||||
echo 'Info: Checking for prerequisites and creating folders...'
|
echo 'Info: Checking for prerequisites and creating folders...'
|
||||||
if [ -d /usrdata/opt ]; then
|
if [ -d /opt ]; then
|
||||||
echo 'Warning: Folder /usrdata/opt exists!'
|
echo 'Warning: Folder /opt exists!'
|
||||||
else
|
else
|
||||||
mkdir /usrdata/opt
|
mkdir /opt
|
||||||
fi
|
fi
|
||||||
# no need to create many folders. entware-opt package creates most
|
# no need to create many folders. entware-opt package creates most
|
||||||
for folder in bin etc lib/opkg tmp var/lock
|
for folder in bin etc lib/opkg tmp var/lock
|
||||||
do
|
do
|
||||||
if [ -d "/usrdata/opt/$folder" ]; then
|
if [ -d "/opt/$folder" ]; then
|
||||||
echo "Warning: Folder /usrdata/opt/$folder exists!"
|
echo "Warning: Folder /opt/$folder exists!"
|
||||||
echo 'Warning: If something goes wrong please clean /usrdata/opt folder and try again.'
|
echo 'Warning: If something goes wrong please clean /opt folder and try again.'
|
||||||
else
|
else
|
||||||
mkdir -p /usrdata/opt/$folder
|
mkdir -p /opt/$folder
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo 'Info: Opkg package manager deployment...'
|
echo 'Info: Opkg package manager deployment...'
|
||||||
URL=http://bin.entware.net/${ARCH}/installer
|
URL=http://bin.entware.net/${ARCH}/installer
|
||||||
wget $URL/opkg -O /usrdata/opt/bin/opkg
|
wget $URL/opkg -O /opt/bin/opkg
|
||||||
chmod 755 /usrdata/opt/bin/opkg
|
chmod 755 /opt/bin/opkg
|
||||||
wget $URL/opkg.conf -O /usrdata/opt/etc/opkg.conf
|
wget $URL/opkg.conf -O /opt/etc/opkg.conf
|
||||||
|
|
||||||
echo 'Info: Basic packages installation...'
|
echo 'Info: Basic packages installation...'
|
||||||
/usrdata/opt/bin/opkg update
|
/opt/bin/opkg update
|
||||||
if [ $TYPE = 'alternative' ]; then
|
if [ $TYPE = 'alternative' ]; then
|
||||||
/usrdata/opt/bin/opkg install busybox
|
/opt/bin/opkg install busybox
|
||||||
fi
|
fi
|
||||||
/usrdata/opt/bin/opkg install entware-opt
|
/opt/bin/opkg install entware-opt
|
||||||
|
|
||||||
# Fix for multiuser environment
|
# Fix for multiuser environment
|
||||||
chmod 777 /usrdata/opt/tmp
|
chmod 777 /opt/tmp
|
||||||
|
|
||||||
for file in passwd group shells shadow gshadow; do
|
for file in passwd group shells shadow gshadow; do
|
||||||
if [ $TYPE = 'generic' ]; then
|
if [ $TYPE = 'generic' ]; then
|
||||||
if [ -f /etc/$file ]; then
|
if [ -f /etc/$file ]; then
|
||||||
ln -sf /etc/$file /usrdata/opt/etc/$file
|
ln -sf /etc/$file /opt/etc/$file
|
||||||
else
|
else
|
||||||
[ -f /usrdata/opt/etc/$file.1 ] && cp /usrdata/opt/etc/$file.1 /usrdata/opt/etc/$file
|
[ -f /opt/etc/$file.1 ] && cp /opt/etc/$file.1 /opt/etc/$file
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -f /usrdata/opt/etc/$file.1 ]; then
|
if [ -f /opt/etc/$file.1 ]; then
|
||||||
cp /usrdata/opt/etc/$file.1 /usrdata/opt/etc/$file
|
cp /opt/etc/$file.1 /opt/etc/$file
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -f /etc/localtime ] && ln -sf /etc/localtime /usrdata/opt/etc/localtime
|
[ -f /etc/localtime ] && ln -sf /etc/localtime /opt/etc/localtime
|
||||||
|
|
||||||
echo 'Info: Congratulations!'
|
echo 'Info: Congratulations!'
|
||||||
echo 'Info: If there are no errors above then Entware was successfully initialized.'
|
echo 'Info: If there are no errors above then Entware was successfully initialized.'
|
||||||
echo 'Info: Add /usrdata/opt/bin & /usrdata/opt/sbin to $PATH variable'
|
echo 'Info: Add /opt/bin & /opt/sbin to $PATH variable'
|
||||||
echo 'Info: Add "/usrdata/opt/etc/init.d/rc.unslung start" to startup script for Entware services to start'
|
echo 'Info: Add "/opt/etc/init.d/rc.unslung start" to startup script for Entware services to start'
|
||||||
if [ $TYPE = 'alternative' ]; then
|
if [ $TYPE = 'alternative' ]; then
|
||||||
echo 'Info: Use ssh server from Entware for better compatibility.'
|
echo 'Info: Use ssh server from Entware for better compatibility.'
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user