共计 1204 个字符,预计需要花费 4 分钟才能阅读完成。
前提:
· R3P 路由器已开启 ssh(办法可见)
确认路由器架构信息
root@XiaoQiang:~# cat /etc/openwrt_release | |
DISTRIB_ID="OpenWrt" | |
DISTRIB_RELEASE="Attitude Adjustment" | |
DISTRIB_REVISION="unknown" | |
DISTRIB_CODENAME="attitude_adjustment" | |
DISTRIB_TARGET="ramips/mt7621" #此处显示路由器的架构信息 | |
DISTRIB_DESCRIPTION="OpenWrt Attitude Adjustment 12.09.1" |
装置 opkg
· 应用 /opt 门路(原脚本指定)装置
留神:会挂载笼罩原有 /opt 门路下的内容
ssh 192.168.31.1 | |
mkdir -p /userdisk/opkg/opt | |
mount -o bind /userdisk/opkg/opt /opt #会笼罩 /opt 原有内容,按需应用 | |
cd /userdisk/opkg | |
wget http://pkg.entware.net/binaries/mipsel/installer/installer.sh | |
chmod +x installer.sh | |
./installer.sh | |
echo "export PATH=${dir}sbin:${dir}bin:"'$PATH' >> /etc/profile | |
source /etc/profile | |
#不应用时卸载门路(重启也可) | |
ummount /opt |
· 自定义门路装置(未测试)
root@XiaoQiang:~# ls /opt/ | |
filetunnel plugin_sandbox |
因为不晓得 /opt 目录中已存在的上边两个目录是做什么的,
为了不影响原有文件构造,有了这个思路,
其实就是替换了 /opt/ 的门路。
未经测试,请自行测试
未经测试,请自行测试
未经测试,请自行测试
ssh 192.168.31.1 | |
dir='/userdisk/opkg/' | |
mkdir -p $dir | |
cd $dir | |
wget http://pkg.entware.net/binaries/mipsel/installer/installer.sh | |
chmod +x installer.sh | |
sed -i "s%/opt/%${dir}%g" installer.sh | |
sed -i "/installation/i dir=${dir}" installer.sh | |
sed -i '/installation/i for f in `grep -rl"/opt/"$dir`; do sed -i"s%/opt/%${dir}%g"$f; done' installer.sh | |
./installer.sh | |
echo "export PATH=${dir}sbin:${dir}bin:"'$PATH' >> /etc/profile | |
source /etc/profile | |
opkg updata |
正文完