使用UUID挂载U盘或移动硬盘至/opt目录
修改/etc/opkg.conf添加一行 dest usb /opt/Packages
修改/etc/profile添加
if [ -d /opt/Packages ]; then
export USB=/opt/Packages
export PATH=$PATH:$USB/usr/bin:$USB/usr/sbin
export LD_LIBRARY_PATH=$USB/lib:$USB/usr/lib
fi
下载host文件,屏蔽广告
#!/bin/sh
logger Downloading HostsX.orzhosts
if [ -s /tmp/HostsX.orzhosts ]; then
rm /tmp/HostsX.orzhosts
fi
wget -P /tmp http://hostsx.googlecode.com/svn/trunk/HostsX.orzhostslogger Downloading Smarthosts
if [ -s /tmp/Smart.hosts ]; then
rm /tmp/Smart.hosts
fi
wget http://smarthosts.googlecode.com/svn/trunk/hosts -O /tmp/Smart.hosts配置dnsmasq
addn-hosts=/tmp/HostsX.orzhostsn
addn-hosts=/tmp/Smart.hosts配置Samba共享目录/opt
配置miniDLNA共享目录
media_dir=/opt db_dir=/opt/.minidlna(可选)
安装ffmpeg支持miniDLNA共享各种格式的video
安装python,python-openssl, pyopenssl至U盘
opkg install -d usb python python-openssl pyopenssl(好像不需要这个)
注意,安装软件至U盘中后,某些启动脚本需要链接到相应位置,比如
ln -s /opt/Package/etc/init.d/xx /etc/init.d/xx
ln -s /opt/Package/etc/config/yy /etc/config/yy
安装coreutils-nohup
opkg install coreutils-nohup
运行goagent
nohup python /opt/goagent-x.y.z/proxy.py >> /dev/null 2>&1 &