router: others: one version for ARM and MIPS branch; clean-up
parent
d8a1a93ed5
commit
a5d2f0e132
@ -0,0 +1,60 @@
|
||||
#!/bin/sh
|
||||
|
||||
export PATH=/opt/sbin:/opt/bin:$PATH
|
||||
unset LD_LIBRARY_PATH
|
||||
unset LD_PRELOAD
|
||||
# STUBBYNO-BEGIN
|
||||
WGET="/usr/bin/wget --no-check-certificate"
|
||||
# STUBBYNO-END
|
||||
# STUBBY-BEGIN
|
||||
WGET="/usr/bin/wget"
|
||||
# STUBBY-END
|
||||
|
||||
URL=http://pkg.entware.net/binaries/mipsel/installer
|
||||
|
||||
echo "Info: Creating folders..."
|
||||
for folder in bin etc/init.d lib/opkg sbin share tmp usr var/log var/lock var/run; do
|
||||
[ -d "/opt/$folder" ] && {
|
||||
echo "Warning: Folder /opt/$folder exists! If something goes wrong please clean /opt folder and try again."
|
||||
} || {
|
||||
mkdir -p /opt/$folder
|
||||
}
|
||||
done
|
||||
|
||||
dl () {
|
||||
# $1 - URL to download
|
||||
# $2 - place to store
|
||||
# $3 - 'x' if should be executable
|
||||
echo -n "Downloading $2... "
|
||||
$WGET -q $1 -O $2
|
||||
[ $? -eq 0 ] && {
|
||||
echo "success!"
|
||||
} || {
|
||||
echo "failed!"
|
||||
exit 1
|
||||
}
|
||||
[ -z "$3" ] || chmod +x $2
|
||||
}
|
||||
|
||||
echo "Info: Deploying opkg package manager..."
|
||||
dl $URL/opkg /opt/bin/opkg x
|
||||
dl $URL/opkg.conf /opt/etc/opkg.conf
|
||||
dl $URL/profile /opt/etc/profile x
|
||||
dl $URL/rc.func /opt/etc/init.d/rc.func
|
||||
dl $URL/rc.unslung /opt/etc/init.d/rc.unslung x
|
||||
|
||||
echo "Info: Basic packages installation..."
|
||||
opkg update
|
||||
opkg install ldconfig findutils
|
||||
ldconfig > /dev/null 2>&1
|
||||
[ -f /etc/TZ ] && ln -sf /etc/TZ /opt/etc/TZ
|
||||
|
||||
cat << EOF
|
||||
|
||||
Congratulations! If there are no errors above then Entware-ng is successfully initialized.
|
||||
|
||||
Found a Bug? Please report at https://github.com/Entware-ng/Entware-ng/issues
|
||||
|
||||
Type 'opkg install <pkg_name>' to install necessary package.
|
||||
|
||||
EOF
|
@ -0,0 +1,195 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Turn off/on all led for Asus routers RT-N16, RT-N66U, RT-AC66U, RT-AC68U
|
||||
#
|
||||
# Version: 0.11
|
||||
# Authors: Monter, Shibby, hasIPv6
|
||||
#
|
||||
|
||||
# configuration
|
||||
VERSION="v0.11"
|
||||
# /configuration
|
||||
|
||||
# Send your bug report to monter[at]techlog.pl
|
||||
|
||||
dir=$(/bin/echo $( cd "$(/usr/bin/dirname "$0")" ; /bin/pwd -P ))
|
||||
stms=$(/usr/bin/basename ${0})
|
||||
MAKE=$(/bin/nvram get t_model_name | /usr/bin/awk '{print $1}')
|
||||
MODEL=$(/bin/nvram get t_model_name | /usr/bin/awk '{print $2}')
|
||||
USB3=$(/usr/bin/lsusb | /bin/grep -v "Device 001" | /bin/grep "Bus 001")
|
||||
USB2=$(/usr/bin/lsusb | /bin/grep -v "Device 001" | /bin/grep "Bus 002")
|
||||
LOGS="/usr/bin/logger -s -t stealthMode"
|
||||
|
||||
case "$MAKE" in
|
||||
"Asus")
|
||||
;;
|
||||
*)
|
||||
$LOGS "Router Brand does not support this feature"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
case "$MODEL" in
|
||||
"RT-N16"|"RT-N66U"|"RT-AC66U"|"RT-AC68R/U")
|
||||
;;
|
||||
*)
|
||||
$LOGS "Router Model does not support this feature"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
on)
|
||||
case "$MODEL" in
|
||||
"RT-N16"|"RT-N66U"|"RT-AC66U"|"RT-AC68R/U")
|
||||
/usr/sbin/et robowr 0x00 0x18 0x1e0
|
||||
;;
|
||||
*)
|
||||
exit 99
|
||||
esac
|
||||
# strobo effect
|
||||
/bin/sleep 1
|
||||
|
||||
$dir/$stms perm_on
|
||||
$LOGS "Activated"
|
||||
/usr/sbin/cru a stealthmode "*/5 * * * * $dir/$stms perm_on"
|
||||
;;
|
||||
perm_on)
|
||||
case "$MODEL" in
|
||||
"RT-N16")
|
||||
# power led
|
||||
/sbin/gpio enable 1
|
||||
# unlock lan ports
|
||||
/usr/sbin/et robord 0x1 0x4 > /dev/null 2>&1
|
||||
/usr/sbin/wl -i eth1 leddc 1
|
||||
;;
|
||||
"RT-N66U"|"RT-AC66U")
|
||||
# power led
|
||||
/sbin/gpio enable 12
|
||||
# usb led
|
||||
/sbin/gpio enable 15
|
||||
/usr/sbin/wl -i eth1 leddc 1
|
||||
/usr/sbin/wl -i eth2 leddc 1
|
||||
;;
|
||||
"RT-AC68R/U")
|
||||
# white led at the back
|
||||
/sbin/gpio enable 4
|
||||
# power led
|
||||
/sbin/gpio enable 3
|
||||
# usb2 led
|
||||
/sbin/gpio enable 0
|
||||
# usb3 led
|
||||
/sbin/gpio enable 14
|
||||
/usr/sbin/wl -i eth1 ledbh 10 0
|
||||
/usr/sbin/wl -i eth2 ledbh 10 0
|
||||
;;
|
||||
*)
|
||||
exit 99
|
||||
esac
|
||||
|
||||
case "$MODEL" in
|
||||
"RT-N16"|"RT-N66U"|"RT-AC66U"|"RT-AC68R/U")
|
||||
/usr/sbin/et robowr 0x00 0x18 0x1e0
|
||||
/usr/sbin/et robowr 0x00 0x1a 0x1e0
|
||||
;;
|
||||
*)
|
||||
exit 99
|
||||
esac
|
||||
;;
|
||||
sch_on)
|
||||
[ "${2}" != "" -a "${2}" -le 23 -a "0$(/bin/echo $2 | /usr/bin/tr -d ' ')" -ge 0 ] 2>/dev/null && {
|
||||
[ "${3}" != "" -a "${3}" -le 59 -a "${3}" -eq "${3}" ] 2>/dev/null && SCHMIN=${3} || SCHMIN="0"
|
||||
/usr/sbin/cru a stealthsheduleon $SCHMIN $2 "* * * $dir/$stms on"
|
||||
$LOGS "Scheduled On set to $2:$(/usr/bin/printf "%02d" $SCHMIN)"
|
||||
} || {
|
||||
$LOGS "Scheduled On error - Hour/Minutes not specified!"
|
||||
$dir/$stms
|
||||
exit 1
|
||||
}
|
||||
;;
|
||||
sch_off)
|
||||
[ "${2}" != "" -a "${2}" -le 23 -a "0$(/bin/echo $2 | /usr/bin/tr -d ' ')" -ge 0 ] 2>/dev/null && {
|
||||
[ "${3}" != "" -a "${3}" -le 59 -a "${3}" -eq "${3}" ] 2>/dev/null && SCHMIN=${3} || SCHMIN="0"
|
||||
/usr/sbin/cru a stealthsheduleoff $SCHMIN $2 "* * * $dir/$stms off"
|
||||
$LOGS "Scheduled Off set to $2:$(/usr/bin/printf "%02d" $SCHMIN)"
|
||||
} || {
|
||||
$LOGS "Scheduled Off error - Hour/Minutes not specified!"
|
||||
$dir/$stms
|
||||
exit 1
|
||||
}
|
||||
;;
|
||||
sch_clear)
|
||||
/usr/sbin/cru d stealthsheduleon
|
||||
/usr/sbin/cru d stealthsheduleoff
|
||||
$LOGS "Scheduler Tasks Deleted"
|
||||
;;
|
||||
clear_all)
|
||||
$dir/$stms sch_clear
|
||||
$LOGS "Complete shutdown and delete all jobs from Crontab - done"
|
||||
;;
|
||||
off)
|
||||
/usr/sbin/cru d stealthmode
|
||||
case "$MODEL" in
|
||||
"RT-N16")
|
||||
#power led
|
||||
/sbin/gpio disable 1
|
||||
# unlock lan ports
|
||||
/usr/sbin/et robord 0x1 0x4 > /dev/null 2>&1
|
||||
/usr/sbin/wl -i eth1 leddc 0
|
||||
;;
|
||||
"RT-N66U"|"RT-AC66U")
|
||||
# power led
|
||||
/sbin/gpio disable 12
|
||||
# usb led
|
||||
/sbin/gpio disable 15
|
||||
/usr/sbin/wl -i eth1 leddc 0
|
||||
/usr/sbin/wl -i eth2 leddc 0
|
||||
;;
|
||||
"RT-AC68R/U")
|
||||
# white led at the back
|
||||
/sbin/gpio disable 4
|
||||
# power led
|
||||
/sbin/gpio disable 3
|
||||
[ "$USB2" != "" ] && /sbin/gpio disable 0
|
||||
[ "$USB3" != "" ] && /sbin/gpio disable 14
|
||||
/usr/sbin/wl -i eth1 ledbh 10 7
|
||||
/usr/sbin/wl -i eth2 ledbh 10 7
|
||||
;;
|
||||
*)
|
||||
exit 99
|
||||
esac
|
||||
case "$MODEL" in
|
||||
"RT-N16"|"RT-N66U"|"RT-AC66U"|"RT-AC68R/U")
|
||||
/usr/sbin/et robowr 0x00 0x18 0x1ff
|
||||
/usr/sbin/et robowr 0x00 0x1a 0x1ff
|
||||
# delay before repeat off commands - strobo error fix
|
||||
/bin/sleep 1
|
||||
/usr/sbin/et robowr 0x00 0x18 0x1ff
|
||||
/usr/sbin/et robowr 0x00 0x1a 0x1ff
|
||||
;;
|
||||
*)
|
||||
exit 99
|
||||
esac
|
||||
$LOGS "Deactivated"
|
||||
;;
|
||||
*)
|
||||
/bin/echo "$stms ${VERSION} by Monter"
|
||||
/bin/echo "Usage: $stms {on|off|sch_on <H> <M>|sch_off <H> <M>|sch_clear|clear_all}"
|
||||
/bin/echo
|
||||
/bin/echo " [Standard mode]"
|
||||
/bin/echo " on | off - enable or disable steathMode in real time"
|
||||
/bin/echo
|
||||
/bin/echo " [Scheduled mode]"
|
||||
/bin/echo " sch_on <H> <M> - set the hour and minutes of the scheduled enable/disable"
|
||||
/bin/echo " sch_off <H> <M> stealthMode in Standard mode and adding jobs to the Crontab"
|
||||
/bin/echo " Hour and minute time must be a numbers without any additional"
|
||||
/bin/echo " characters, where hour is a mandatory parameter, while not"
|
||||
/bin/echo " specifying an minute will assign a default 00 value"
|
||||
/bin/echo " These options add just the right job for Crontab, nothing more"
|
||||
/bin/echo " sch_clear - removes tasks from Crontab for scheduled enable/disable"
|
||||
/bin/echo " stealthMode function set by sch_on and sch_off switches"
|
||||
/bin/echo
|
||||
/bin/echo " [Repair / debug]"
|
||||
/bin/echo " clear_all - removes all jobs from Crontab and completely disables all"
|
||||
/bin/echo " available stealthMode modes"
|
||||
/bin/echo
|
||||
exit 1
|
||||
esac
|
@ -1,17 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
a=`cat /proc/cpuinfo | grep BogoMIPS | head -1 | awk {' print $3'} | awk '{printf "%0.1f %s\n", $1/100}' | awk '{printf "%s\n", $1*50}'`
|
||||
a=$(cat /proc/cpuinfo | grep BogoMIPS | head -1 | awk {' print $3'} | awk '{printf "%0.1f %s\n", $1/100}' | awk '{printf "%s\n", $1*50}')
|
||||
|
||||
b=`cat /proc/cpuinfo | grep processor | wc -l`
|
||||
b=$(cat /proc/cpuinfo | grep processor | wc -l)
|
||||
|
||||
if [ $b -le "1" ]; then
|
||||
c="single"
|
||||
else
|
||||
c="dual"
|
||||
fi
|
||||
[ $b -le "1" ] && {
|
||||
c="single"
|
||||
} || {
|
||||
c="dual"
|
||||
}
|
||||
|
||||
d=`cat /proc/dmu/temperature | head -1 | awk '{ print substr($4,1,length($4)-2)}'`
|
||||
if [ ! $d ]; then d="--"; fi
|
||||
d=$(cat /proc/dmu/temperature | head -1 | awk '{ print substr($4,1,length($4)-2)}')
|
||||
[ ! $d ] && d="--"
|
||||
|
||||
echo "cpu MHz : $a MHz ($c" > /tmp/sysinfo-helper
|
||||
echo "cpu Temp : $d" >> /tmp/sysinfo-helper
|
||||
|
@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# v1.00 Shibby 2013
|
||||
# v1.01 Fix memory leak + cosmetics - pedro 2019
|
||||
# v1.02 rs232 06/2021
|
||||
#
|
||||
|
||||
[ ! "$(nvram get web_css)" == "online" ] && exit 0
|
||||
|
||||
PID=$$
|
||||
LOCK="/tmp/ttb.lock"
|
||||
DIR="/www/ext"
|
||||
LOGS="logger -t TTB[$PID]"
|
||||
URL_ORIG="http://ttb.mooo.com http://ttb.ath.cx http://ttb.ddnsfree.com"
|
||||
# STUBBYNO-BEGIN
|
||||
WGET="/usr/bin/wget --no-check-certificate"
|
||||
# STUBBYNO-END
|
||||
# STUBBY-BEGIN
|
||||
WGET="/usr/bin/wget"
|
||||
# STUBBY-END
|
||||
|
||||
ttbshuf() {
|
||||
awk 'BEGIN {srand(); OFMT="%.17f"} {print rand(), $0}' "$@" | sort -k1,3n | cut -d ' ' -f2-;
|
||||
}
|
||||
|
||||
# script in action
|
||||
[ -f $LOCK ] && {
|
||||
$LOGS "Another process in action - exiting"
|
||||
exit 0
|
||||
} || {
|
||||
touch $LOCK
|
||||
TTB=$(nvram get ttb_css)
|
||||
|
||||
# no skin
|
||||
[ ! -f $DIR/$TTB.css ] && {
|
||||
# no skin but zip with skin is available
|
||||
[ -f $DIR/$TTB.zip ] && {
|
||||
unzip -o $DIR/$TTB.zip -d $DIR/
|
||||
$LOGS "Online theme [ $TTB ] has been applied"
|
||||
cru d ttbDL
|
||||
# no skin either zip
|
||||
} || {
|
||||
rm $DIR/*.css $DIR/*.zip $DIR/*.png $DIR/*.gif $DIR/*.jpg >/dev/null 2>&1
|
||||
echo $URL_ORIG | tr ' ' '\n' | ttbshuf | tr ' ' '\n' | sed 's/\/$//' |
|
||||
while read l; do
|
||||
$WGET -U "Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/88.0" -T 10 -t 1 $l/$TTB.zip -O $DIR/$TTB.zip >/dev/null 2>&1 && echo $l && break
|
||||
done
|
||||
sleep 1
|
||||
|
||||
# zip downloaded
|
||||
[ -f $DIR/$TTB.zip ] && {
|
||||
unzip -o $DIR/$TTB.zip -d $DIR/
|
||||
$LOGS "Online theme [ $TTB ] has been downloaded and applied"
|
||||
cru d ttbDL
|
||||
# can't download zip!!
|
||||
} || {
|
||||
$LOGS "Cannot download Online theme. Will try again soon ..."
|
||||
cru a ttbDL "*/5 * * * * /usr/sbin/ttb"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rm $LOCK
|
||||
}
|
Loading…
Reference in New Issue