- 树莓派映射网络磁盘
sudo mount -t cifs -o username=jerry.huang,password=Hello2014 //10.10.0.1/Public/ESLPod.com /home/pi/t/ESLPod.com/
树莓派分区参考:
http://bbs.ickey.cn/group-topic-id-35428.html - 树莓派使用 sudo nano 编辑保存文件
修改静态IP,需要修改/etc/network/interfaces文件
原文件内容auto lo iface lo inet loopback
iface eth0 inet dhcp allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp修改为静态IP
auto lo iface lo inet loopback
iface eth0 inet static address 10.10.0.91
netmask 255.255.255.0
gateway 10.10.0.254 allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp编辑自动定时任务/etc/crontab
, -,- * * - root /home/pi/playESLPod.sh
-,- * * - root /home/pi/playNews.sh
* * - root /home/pi/playNews.sh
* * - root /home/pi/stopMplayer.sh
* * - root /home/pi/stopMplayer.sh
* * - root /home/pi/stopMplayer.sh
* * - root /home/pi/playMusic.sh
* * - root /home/pi/stopMplayer.sh - 播放MP3、网络广播的脚本
播放本地音乐playESLPod.sh
#!/bin/sh
sudo pkill -f mplayer;
sudo mplayer -shuffle /home/pi/t/ESLPod.com/* < /dev/null > /dev/null 2>1&playESLPod.sh Code
播放网络playNews.sh
#!/bin/sh
sudo pkill -f mplayer;
sudo mplayer -loop -playlist "http://rthk.hk/live2.m3u" < /dev/null > /dev/null >&playNews.sh Code
播放runMplayer.sh
#!/bin/sh
if (ps -A|grep "mplayer");then
sudo pkill -f mplayer;
fi
sudo mplayer -loop -playlist "http://rthk.hk/live$1.m3u" < /dev/null > /dev/null >&runMplayer.sh Code
停止stopMplayer.sh
#!/bin/sh
sudo pkill -f mplayer;stopMplayer.sh Code