-
-
Save aadps/3729f610cb0d8b8543ce637b6eb1f28c to your computer and use it in GitHub Desktop.
IPTV预约录像脚本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
m3u="/www/1.m3u" | |
dvrpath="/mnt/media/" | |
echo -n "频道名:" | |
read chan | |
while [ -z $(cat /www/1.m3u | grep ${chan} -A 1 | head -2 | tail -1) ]; do | |
echo -n "无此频道,请重新输入:" | |
read chan | |
done | |
echo -n "预约时间:" | |
read attime | |
echo -n "录制时长(默认1h):" | |
read duration | |
[ -z "$duration" ] && duration="1h" | |
echo -n "文件备注:" | |
read file | |
echo "timeout ${duration} wget $(cat ${m3u} | grep ${chan} -A 1 | head -2 | tail -1) --ignore-length -O ${dvrpath}\$(date +"%y%m%d")${file}.mp4" | at ${attime} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment