#!/bin/sh ######## cgiの設定がなされていません。 export LANG=ja_JP.eucJP version=1.0.6c web_version="menat-web.cgi-$version" menat_version=`head -n 1 /var/menat/version` menat_sys_d=/etc/menat vs_ls=`cat $menat_sys_d/vs.list` org_menat_h_t=/var/menat/localhost/menat/tmp p_qs=`echo $QUERY_STRING|sed 's/%/\\\\x/g'` m_v=`printf "$p_qs\n"` m_v0=$m_v exe_hn=`hostname` exe_host_b=${exe_host_n%%.*} ma_user="${REMOTE_USER:-$exe_host_b}" ma_host="${REMOTE_ADDR:-127.0.0.1}" date_12() { d12_Y=${2:0:4} d12_m=${2:4:2} d12_d=${2:6:2} d12_H=${2:8:2} d12_M=${2:10:2} date -d "$1 $d12_Y-$d12_m-$d12_d $d12_H:$d12_M" '+%Y%m%d%H%M' } n_ident() { if [ "$1" = 0 ];then dvn=0 dvn_v=0 else dvn=`expr "$1" + 0 2>/dev/null`;dvn_v=$? fi if [ $dvn_v = 0 ];then ni_v=$1 while [ ${ni_v:0:1} = 0 ]&&[ ${#ni_v} != 1 ];do ni_v=${ni_v#0} if [ ${#ni_v} = 1 ];then break fi done echo $ni_v return 0 else echo ${2:-unknown} return $dvn_v fi } ft_date() { if [ "$2" = 1 ];then f_ft=`find $1 -maxdepth 0 -follow -printf '%TY-%Tm-%Td %Ta %TH:%TM\n'`;f_v=$? else f_ft=`find $1 -maxdepth 0 -follow -printf '%TY%Tm%Td%TH%TM\n'`;f_v=$? fi if [ $f_v = 0 ];then echo $f_ft return 0 else return $f_v fi } ln_keeper() { lk_fn=${1:-$ma_htrm} max_ln=${2:-16} max_cap=${3:-2} cap_ln=$(($max_cap*$max_ln)) f_ln=`cat $lk_fn|wc -l` if [ $f_ln -gt $cap_ln ];then d_ln=$(($f_ln-$max_ln)) ed -s $lk_fn<" $1|head -n1` tk=${tk#*\[};tk=${tk%% *} date -d "$tk" '+%m%d' return $? } if [ "$m_v" ];then dg=`echo $m_v|sed 's/&/ /g'` for qsv in $dg ;do ds_vs_v=${qsv%%_*} if [ "$ds_vs_v" = act ];then vs_hn=${qsv#act_} vs_hn=${vs_hn%%=*} act=1 elif [ "$ds_vs_v" = maexe ];then vs_hn=${qsv#maexe_} vs_hn=${vs_hn%%=*} maexe=1 elif [ "$ds_vs_v" = kousin ];then vs_hn_0=${qsv#kousin_};vs_hn=${vs_hn_0%_*=予約登録の更新} kousin=${vs_hn_0%%=*};kousin=${kousin#*_} elif [ "$ds_vs_v" = wol ];then vs_hn_0=${qsv#wol_};vs_hn=${vs_hn_0%_*=WOLによる起動} wol_rtm=${vs_hn_0%%=*};wol_rtm=${wol_rtm#*_} else if [ ! "${qsv##*\$*}" ]||[ ! "${qsv##*\(*}" ]||[ ! "${qsv##*\`*}" ];then continue else eval $qsv fi fi done fi ##### .ht files ###### if [ -d .htdir ];then htdir=".htdir/" else htdir="" fi ma_htrm=$htdir.htrm$ma_host ma_htmaexe=$htdir.htmaexe.$ma_host ma_htmaexe2=$htdir.htmaexe2.$ma_host ma_htmdss=$htdir.htmdss ma_htwol=$htdir.htwol ma_htchsl=$htdir.htchsl ma_htprogptok=$htdir.htprogptok.$ma_user ma_htprogtok=$htdir.htprogtok if [ ! -f $ma_htrm ];then touch $ma_htrm fi ############## system configuration ################## ################################################################# user_h=/var/menat if [ ! "$vs_ls" ];then t_vs_ls=`ls /var/menat` for d in $t_vs_ls ;do if [ $d = public_html ]||[ $d = bin ];then continue fi if [ -d $user_h/$d ];then vs_ls="$vs_ls $d" fi done if [ ! "$vs_ls" ];then cgi_err=1 fi fi if [ ! "$vs_hn" ];then cgi_err=1 for t in $vs_ls ;do if [ ! -d $user_h/$t ];then continue fi vs_h=$user_h/$t vs_hn=${t%%.*} vs_name=$t vs_uri="http://$t/~menat" menat_h=$vs_h/menat menat_h_t=$menat_h/tmp ma_h=$vs_h/vfiles ma_h_t=$ma_h/tmp cgi_err="" break done else for t in $vs_ls ;do tt=${t%%.*} if [ $vs_hn = $tt ];then vs_name=$t vs_uri="/~menat" break fi done if [ ! "$vs_uri" ]||[ ! -d $user_h/$vs_name ];then cgi_err=1 else vs_h=$user_h/$vs_name menat_h=$vs_h/menat menat_h_t=$menat_h/tmp ma_h=$vs_h/vfiles ma_h_t=$ma_h/tmp fi fi ############################################################################## ############################################################################## ############################################################################## exe_hn_addr=`hostname -i` exe_hn_addr=${exe_hn_addr##*127.0.0.1 } vs_hn_addr=`host $vs_name`;vs_hn_addr=${vs_hn_addr##* } vs_hn_domain=${vs_hn_addr%.*};vs_hn_domain=${vs_hn_domain%.*} if [ $ma_host = $vs_hn_addr ]||[ "$vs_hn" = localhost ];then exe_hn_on=1 auth_v=0 admin_v=0 elif [ $ma_host = $exe_hn_addr ];then exe_hn_on=2 else exe_hn_on=0 fi if [ "$ma_host" = 127.0.0.1 ]&&[ "$auth_v" != 0 ];then ma_host=$exe_hn_addr ma_exe_host="-h $ma_host" elif [ "$ma_host" ];then ma_exe_host="-h $ma_host" fi if [ ! "$ma_user" ];then if [ "$auth_v" = 0 ];then ma_user=menat else if [ $vs_hn = localhost ];then ma_user=${exe_hn%%.*} else ma_user=$vs_hn fi for t in $vs_ls ;do if [ ${t%%.*} = $ma_user ];then un_ok=0 break fi done if [ "$un_ok" != 0 ];then ma_user=localhost fi fi fi if [ "$fa_user" ];then ma_user=$fa_user fi ma_auth="-a $ma_user" ############################################################################## ############################################################################## ############################################################################## if [ -f $menat_sys_d/menat.conf ];then . $menat_sys_d/menat.conf fi exe_host_domain=${exe_hn_addr%.*};exe_host_domain=${exe_host_domain%.*} lnw_addr=${lnw_addr:-$exe_host_domain} ma_host_domain=${ma_host%.*};ma_host_domain=${ma_host_domain%.*} if [ "$ma_host_domain" != $lnw_addr ];then vs_name_n=`echo "$conf_ref_vs_name"|wc -w` if [ ${vs_name_n:-0} = 0 ];then ref_vs_name=$vs_name elif [ $vs_name_n = 1 ];then ref_vs_name=${conf_ref_vs_name%=*} else for t in $conf_ref_vs_name ;do ref_vs_hn=${t#*=} if [ $ref_vs_hn = $vs_hn ];then ref_vs_name=${t%=$vs_hn} ref_vs_name_ok=1 break fi done if [ ${ref_vs_name_ok:-0} != 1 ];then ref_vs_name=$vs_name fi fi else ref_vs_name=$vs_name fi if [ -f "$vs_ls_auth" ];then vs_auth=`grep $vs_name $vs_ls_auth`;grep_v=$? if [ $grep_v = 0 ];then wget_pass=${vs_auth#*:};wget_pass=${wget_pass%:*};wget_pass="${wget_pass%:*}@" cgi_pass=${vs_auth#*:};cgi_pass=${cgi_pass#*:};cgi_pass="${cgi_pass#*:}@" else wget_pass="" cgi_pass="" fi else wget_pass="" cgi_pass="" fi if [ $vs_hn_domain != $lnw_addr ];then vs_href="http://$wget_pass$ref_vs_name/~menat/" else vs_href="http://$wget_pass$vs_name/~menat/" fi if [ ${ma_user:-guest} != guest ];then vs_href_cgi="http://$cgi_pass$vs_name/~menat/" fi if [ ${admin_user:-menat} = $ma_user ];then admin_v=0 auth_v=0 fi menat_bin=$user_h/bin ma_exe=$menat_bin/menat-cr.sh menat_sad=$menat_bin/menat-sad.sh menat_progchk=$menat_bin/menat-progchk.sh menat_http=$user_h/public_html menat_mkprog=$menat_http/menat-mkprog.cgi menat_lock=$menat_h_t/lock.menat org_menat_lock=/var/menat/localhost/menat/tmp/${menat_lock##*/} if [ -f $org_menat_lock ]||[ -d $org_menat_lock ];then ma_run_ex_host=1 for t in `ls $org_menat_lock` ;do if [ `grep -c ^ex_sleep= ${org_menat_lock%/}/$t` = 0 ];then cap_failed=0 break else cap_failed=1 fi done if [ ${cap_ign_host:-0} = 0 ]&&[ "$cap_failed" = 1 ];then cap_ign_host=1 fi else ma_run_ex_host=0 fi if [ -f $menat_lock ]||[ -d $menat_lock ];then ma_run=1 else ma_run=0 fi if [ -f $menat_sys_d/capture.conf ];then ma_ext=`. $menat_sys_d/capture.conf;echo $ma_ext` web_cap_dev=`. $menat_sys_d/capture.conf;echo $cap_dev` fi ma_ext=${ma_ext:-mjp} if [ -f /home/$ma_user/.menatrc ];then . /home/$ma_user/.menatrc fi case "${web_cap_dev#/dev/video}" in [0-3] ) cap_dev=$web_cap_dev ;; * ) cap_dev=/dev/video0 ;dev_rc_err=$web_cap_dev ;; esac ###### cgi_err=1 - vs_ls value false or such directory is not found. ####### ############################################################################ #################### video server configuration end ######################## ############################################################################ menat_iepg_f=$menat_h_t/iepg.$ma_host iepg_ma_exe=${m_v#*maexe_$vs_hn=} iepg_exe_v=${iepg_ma_exe%%iEPG*} if [ ! "$iepg_exe_v" ];then cr_iepg_opt="-I $menat_iepg_f" fi if [ ! "$start_t" ]&&[ ! "$tlong" ]&&[ ! "$ch" ]&&[ ! "$f_name" ];then m_v="" fi if [ "$back_qs" = 0 ];then m_v="" fi if [ "$past" != 1 ];then ma_title="$exe_hn web 録画予約" else ma_title='終了、抹消済み録画予約一覧' fi w_nt=`date '+%Y%m%d%H%M'` w_nt_Ymd=${w_nt:0:8} ma_id=$$ menat_iepg=$vs_h/iepg menat_cgi="menat-web.cgi" ma_ls="menat-less.cgi" p_index="/~menat/index.html" echo "Connection: close" echo "Content-type: text/html" echo echo '' ######################################################################################################## ######################################################################################################## ######################################################################################################## bg_rgb="rgb(204, 204, 204)" df_rgb="rgb(0, 0, 0)" h1_rgb="rgb(0, 0, 80)" fr_rgb="rgb(200, 0, 0)" wrn_rgb="rgb(153, 102, 51)" wrn2_rgb="rgb(53, 62,151)" wrn3_rgb="rgb(255, 220, 0)" ok_rgb="rgb(0, 0, 153)" ok2_rgb="rgb(0, 0, 200)" ok3_rgb="rgb(0, 0, 255)" unk_rgb="rgb(180, 0, 140)" run_rgb="rgb( 1, 102, 102)" cap_rgb="rgb(151, 102, 102)" cap2_rgb="rgb(141, 92, 92)" cap3_rgb="rgb(156, 132, 132)" off_rgb="rgb(102, 102, 102)" mx_rgb="rgb( 0, 0, 204)" iepg1_rgb="rgb(0, 60, 120)" iepg2_rgb="rgb(60, 50, 190)" iepg3_rgb="rgb(200, 50, 20)" vs_rgb="rgb(0, 100, 160)" #table0 color t0bgt_rgb="rgb(204, 204, 204)" #table0 title background color t0bg_rgb="rgb(204, 204, 204)" #table0 default background color t0f0_rgb="rgb(0, 0, 0)" #table0 default font #table1 color t1bg0_rgb="rgb(204, 204, 204)" #table1 default t1f_rgb="rgb(0, 0, 0)" #table1 default #table background-color tbgt_rgb="rgb(204, 204, 204)" #table title okbg_rgb="rgb(190, 190, 210)" #ok background color raw twrn_rgb="rgb(180, 200, 180)" #warning raw twrn2_rgb="rgb(220, 220, 180)" #warning2 raw info_rgb="rgb(210, 160, 160)" #table raw info1 info2_rgb="rgb(160, 160, 200)" #table raw info2 tbg0_rgb="rgb(204, 204, 204)" #table default tbg1_rgb="rgb(180, 180, 180)" #2cycle tbg2_rgb="rgb(152, 152, 152)" #10cycle #table font-color tf0_rgb="rgb(0, 0, 0)" #table font tf1_rgb="rgb(0, 0, 102)" #table font1 tf2_rgb="rgb(52, 102, 102)" #table font2 #calender color cbg_rgb="rgb(204, 204, 204)" #calender default background cf0_rgb="rgb(0, 0, 0)" #default font cf1_rgb="rgb(169, 0, 0)" #Sunday cf2_rgb="rgb(0, 0, 160)" #Satday cf3_rgb="rgb(184, 184, 224)" #today background cf4_rgb="rgb(204, 102, 204)" #act background cf5_rgb="rgb(204, 0, 204)" wrn_astr="*" wrn2_astr="*" ok2_astr="*" if [ -f $vs_h/color.conf ];then . $vs_h/color.conf fi if [ -f $vs_h/.menatrc ];then . $vs_h/.menatrc fi if [ `n_ident $ds_wrn` = unknown ];then ds_wrn="" fi ds_wrn=${ds_wrn:-2048} if [ ! "$def_link" ];then def_link="alink=\"#000088\" link=\"#0000ff\" vlink=\"#ff0000\"" fi if [ "$pvsi" = 1 ];then if [ -f $menat_h_t/vs.html ];then cat $menat_h_t/vs.html else echo " video server disk space information on $org_hn

video server disk space information
$vs_name


This video server has never been shutdowned properly, yet.


 録画予約画面に戻る  ヘルプ

menat-web.cgi-$version $menat_version
" fi exit 0 fi ######################################################################################################## ######################################################################################################## ######################################################################################################## echo '' echo $ma_title for $vs_hn echo "" echo "" echo "

$exe_hn web 録画予約 for $vs_hn

" ######################################################################################################## ######################################################################################################## ######################################################################################################## ######################################################################################################## ######################################################################################################## ######################################################################################################## if [ "$cgi_err" = 1 ];then echo "cgi error occurd. Maybe vs.list configuration is false.

" exit 1 fi if [ -r .htdir/web_pid ];then web_PID=`cat .htdir/web_pid` sl=0 ps_dd=`ps ax` while [ `echo "$ps_dd"|grep -c "^ *$web_PID .*menat-web.cgi"` != 0 ];do if [ $sl -gt 120 ];then break fi sl=$(($sl+1)) # echo "sleep 1s, loop ${sl} web_PID=$web_PID:$$
" sleep 1s ps_dd=`ps ax` done fi echo $$ >.htdir/web_pid delay_H=5 if [ -f $menat_iepg/ch.list ];then ex_ch_ls=1 t_mkprog=.htdir/today.mkprog t_web=.htdir/today.web.$vs_hn if [ -f $t_mkprog ];then mkp_Ymd=`cat $t_mkprog` if [ -f $t_web ];then web_Ymd=`cat $t_web` else web_Ymd=`date -d "-${delay_H}hour" '+%Y%m%d'` fi mkp_1_Ymd=`date -d "-1day" '+%Y%m%d'` if [ "$mkp_Ymd" != "$mkp_1_Ymd" ]&&[ "$mkp_Ymd" != "$w_nt_Ymd" ];then mk_cal_ok=1 mkp_Ymd=`date -d "-${delay_H}hour" '+%Y%m%d'` echo $mkp_Ymd >$t_mkprog elif [ "$mkp_Ymd" = "$mkp_1_Ymd" ];then if [ "$mkp_Ymd" '<' "$web_Ymd" ];then mk_cal_ok=1 mkp_Ymd=$web_Ymd echo $web_Ymd >$t_mkprog else nd_Ymd=`date -d "-${delay_H}hour" '+%Y%m%d'` if [ "$mkp_Ymd" != "$nd_Ymd" ];then mkp_Ymd=$nd_Ymd echo $mkp_Ymd >$t_mkprog mk_cal_ok=1 fi fi else if [ "$mkp_Ymd" != "$web_Ymd" ];then mk_cal_ok=1 fi fi else mkp_Ymd=`date -d "-${delay_H}hour" '+%Y%m%d'` echo $mkp_Ymd >$t_mkprog fi else ex_ch_ls=0 mkprog_ok=0 fi htmaexe="$ma_htmaexe" htmaexe2="$ma_htmaexe2" if [ "$iepg" ];then echo 0 >$htmaexe exe_v=0 act=1 else exe_v=`cat $htmaexe` fi #echo "$htmaexe exe_v=$exe_v
" if [ "$maexe" ]&&[ "$exe_v" = 1 ];then m_v="" start_t="";tlong="";ch="";f_name="" maexe_reload=1 fi if [ `printf "\x3A00\n"` != ":00" ];then start_t_or=${QUERY_STRING##*start_t=} start_t=${start_t_or%%\&*} start_t=`echo $start_t|sed 's/%2F/\//g;s/%3A/:/g'` fi ss_or=$start_t start_t=`echo $start_t|sed 's/\///g;s/ //g;s/://g;s/-//g;s/+//g'` org_ts=`echo $ss_or|sed 's/+/ /g'` if [ ${tlong:-0} = iepg_auto ];then act=1 pg_iepg_dd=`$menat_progchk -c $ch -i ${start_t:0:12}` if [ "$pg_iepg_dd" ];then pg_iepg_st=`echo "$pg_iepg_dd" |grep ^start:`;pg_iepg_st=${pg_iepg_st#start: } pg_iepg_et=`echo "$pg_iepg_dd" |grep ^end:`;pg_iepg_et=${pg_iepg_et#end: } pg_iepg_ext=`echo "$pg_iepg_dd" |grep ^Extend:`;pg_iepg_ext=${pg_iepg_ext#Extend: } pg_iepg_Ymd=${start_t:0:8} pg_iepg_st_s=`date -d "$pg_iepg_Ymd $pg_iepg_st" '+%s'` if [ $pg_iepg_st '>' $pg_iepg_et ];then pg_iepg_et_s=`date -d "$pg_iepg_Ymd $pg_iepg_et 1day" '+%s'` else pg_iepg_et_s=`date -d "$pg_iepg_Ymd $pg_iepg_et" '+%s'` fi if [ ${pg_iepg_ext:-0} -gt 0 ];then tlong=$(($(($(($pg_iepg_et_s-$pg_iepg_st_s))/60))+${pg_iepg_ext})) else tlong=$(($(($pg_iepg_et_s-$pg_iepg_st_s))/60)) fi pg_iepg_ok=1 fi fi org_f_name=${f_name%:*} if [ ${#start_t} -ge 13 ];then r=${start_t:12:1} r14=${start_t:13:1} org_start_t=$start_t case $r in "w" ) weekly_v="-w w";start_t=${start_t:0:12};rt_v=w;; "d" ) weekly_v="-w d";start_t=${start_t:0:12};rt_v=d;; "p" ) weekly_v="-w p";start_t=${start_t:0:12};rt_v=p;; "n" ) cr_no_N=1;wcr_org_id=${org_start_t:13};; "N" ) cr_no_N=2;wcr_org_id=${org_start_t:13};; "x" ) cr_no_N=3;wcr_org_id=x;start_t=${start_t%x};; esac case "$r14" in "n" ) cr_no_N=1;wcr_org_id=${org_start_t:14};; "N" ) cr_no_N=2;wcr_org_id=${org_start_t:14};; "x" ) cr_no_N=3;wcr_org_id=x;; esac if [ "$wcr_org_id" ];then if [ $cr_no_N = 1 ];then wcr_opt="-N $wcr_org_id" elif [ $cr_no_N = 2 ];then wcr_id=`echo $wcr_org_id|sed 's/n/:/'` wcr_opt="-N $wcr_id" else wcr_opt="" fi else wcr_opt="-N 0" fi else wcr_opt="-N 0" fi start_t=${start_t%% *} mv_t=$? n_ident $start_t >/dev/null;dvn_v=$? if [ $dvn_v != 0 ]||[ ${#start_t} != 12 ]||[ "$mv_t" != 0 ];then t_err=1 else ############################################### ############## st_st_YmdHM ################ ############################################### st_st_Y=${start_t:0:4} st_st_m=${start_t:4:2} st_st_d=${start_t:6:2} st_st_H=${start_t:8:2} st_st_M=${start_t:10:2} st_st_Ymd=$st_st_Y$st_st_m$st_st_d st_st_YmdHM=$start_t ############################################## fi if [ 1$st_st_M -gt 159 ]||[ 1$st_st_H -ge 124 ]||[ 1$st_st_d -gt 131 ]||[ 1$st_st_m -gt 112 ];then t_err=1;thm_err=1 else t_err=${t_err:-0} dv=`date -d $st_st_Ymd '+%Y%m%d'` if [ "$dv" != "$st_st_Ymd" ]&&[ "$dv" ];then Ymd_err=1;t_err=1 elif [ ! "$dv" ];then ovt_err=1 fi fi if [ "${tlong##*:}" = s ];then tlong=${tlong%:s} tl_iv_ok=1 input_v=s elif [ "${tlong##*:}" = v ];then tlong=${tlong%:v} tl_iv_ok=1 input_v=v else input_v=c fi if [ ! "$tlong" ];then tl_err=1 elif [ ${#tlong} = 5 ]&&[ ${tlong:2:1} = : ];then tl_H=${tlong:0:2} tl_M=${tlong:3:2} if [ $t_err = 0 ];then if [ $tl_H '<' 24 ]&&[ $tl_M '<' 60 ];then if [ 1$dvn_H -gt 123 ];then tl_err=1 else tlong_org=$tlong if [ 1$st_st_H$st_st_M '>' 1$tl_H$tl_M ]||[ 1$st_st_H$st_st_M = 1$tl_H$tl_M ];then end_tt_Ymd=$(($st_st_Ymd+1)) else end_tt_Ymd=$st_st_Ymd fi st_tt_s=`date -d "$st_st_Ymd $st_st_H:$st_st_M" '+%s'` et_tt_s=`date -d "$end_tt_Ymd $tl_H:$tl_M" '+%s'` tlong_tt_s=$(($et_tt_s-$st_tt_s)) tlong=$(($tlong_tt_s/60)) tl_err=0 fi else tl_err=1 fi else tl_err=1 fi else dvn=`n_ident $tlong`;dvn_v=$? if [ $dvn_v != 0 ];then tl_err=1 else tlong=$dvn tl_err=0 fi fi if [ "$tl_err" != 1 ]&&[ ${#start_t} = 12 ]&&[ "$mv_t" = 0 ];then if [ "$ovt_err" = 1 ];then tt1_Y=${w_nt:0:4} tmp_YmdHM=$tt1_Y$st_st_m$st_st_d$st_st_H$st_st_M tmp_Ymd=${tmp_YmdHM:0:8} tmp2_Ymd=`date -d $tmp_Ymd '+%Y%m%d'` if [ $tmp2_Ymd != $tmp_Ymd ];then Ymd_err=1;t_err=1 fi else tmp_YmdHM=$start_t tmp_Ymd=$st_st_Ymd fi st_et_YmdHM=`date_12 ${tlong}minute $tmp_YmdHM` st_et_1day=`date -d "$st_st_Ymd 1day" '+%Y%m%d'` st_et_Ymd=${st_et_YmdHM:0:8} st_et_H=${st_et_YmdHM:8:2} st_et_M=${st_et_YmdHM:10:2} if [ $tmp_Ymd = $st_et_Ymd ];then t_end=$st_et_H:$st_et_M else if [ ${st_et_Ymd} = ${st_et_1day} ];then t_end="翌 $st_et_H:$st_et_M" else t_end="**:**" tom_over=1 fi fi fi if [ ! "$ch" ];then ch_err=1 ch_cs=0 elif [ "$ch" != v ]&&[ "$ch" != s ];then dvn=`n_ident $ch`;dvn_v=$? if [ $dvn_v != 0 ];then input_ch=${ch:$((${#ch}-1)):1} if [ $input_ch = v ]||[ $input_ch = s ];then ch=${ch%$input_ch} input_v=$input_ch dvn=`n_ident $ch`;dvn_v=$? fi fi if [ $dvn_v != 0 ];then ch_err=1 elif [ "$ch" -le 0 ]||[ "$ch" -gt 63 ];then ch_err=1 elif [ -f $menat_iepg/ch.list ];then ch_err=0 iepg_ch_ls_dd=`grep ch$ch $menat_iepg/ch.list` iepg_web_str=`echo ${iepg_ch_ls_dd}|cut -d':' -f2` st_uri=`echo ${iepg_ch_ls_dd}|cut -d':' -f6` st_uri="http://$st_uri/" fi ch_cs=0 else ch_err=0 ch_cs=1 fi opf_name=${f_name%:*} gg=0 if [ "$f_name" != "$opf_name" ];then if [ "$opf_name" = "${opf_name%:*}" ];then gg=1 else gg=2 fi else gg=0 fi if [ ! "$f_name" ]&&[ "$m_v" ];then f_name="" f_err=1 elif [ "$gg" -gt 1 ];then f_err=1;of_err=1 elif [ "$gg" = 1 ];then f_opt=${f_name##*:} if [ $f_opt = $f_name ];then f_opt="" opt_ok=1 elif [ ${#f_opt} -ge 3 ]&&[ ${#f_opt} -le 6 ];then opt_ok=1 else f_err=1;of_err=1 opt_ok=0 fi fi f_name=${f_name##*/} if [ -f /home/$ma_user/.menatrc.$time_s ];then web2_cap_dev=`. /home/$ma_user/.menatrc.$time_s;echo $cap_dev` fi cd1=${web2_cap_dev#/dev/video} if [ ! "$cd1" ];then cap_dev=${cap_dev:-/dev/video0} else case $cd1 in [0-3] ) cap_dev=$web2_cap_dev ;; * ) cap_dev=/dev/video0 ;dev_rc_err=$web2_cap_dev ;; esac fi if [ "$opt_ok" = 1 ];then opt_c1=${f_opt:0:1} opt_c4=${f_opt:3:1} case "$opt_c1" in [mMvVwWxX] ) cap_dev=/dev/video${opt_c4:-0};cap_dev_n=${opt_c4:-0}; p_cap_dev_n=$opt_c4;; * ) long_opt=1 ;; esac if [ "$long_opt" = 1 ];then opt_c6=${f_opt:5:1} case "$opt_c6" in 0 ) cdn_1="0";cdn_0="0";obp="0";rmf=0;; 1 ) cdn_1="1";cdn_0="0";obp="0";rmf=0;; 2 ) cdn_1="0";cdn_0="1";obp="0";rmf=0;; 3 ) cdn_1="1";cdn_0="1";obp="0";rmf=0;; 4 ) cdn_1="0";cdn_0="0";obp="1";rmf=0;; 5 ) cdn_1="1";cdn_0="0";obp="1";rmf=0;; 6 ) cdn_1="0";cdn_0="1";obp="1";rmf=0;; 7 ) cdn_1="1";cdn_0="1";obp="1";rmf=0;; 8 ) cdn_1="0";cdn_0="0";obp="0";rmf=1;; 9 ) cdn_1="1";cdn_0="0";obp="0";rmf=1;; a ) cdn_1="0";cdn_0="1";obp="0";rmf=1;; b ) cdn_1="1";cdn_0="1";obp="0";rmf=1;; c ) cdn_1="0";cdn_0="0";obp="1";rmf=1;; d ) cdn_1="1";cdn_0="0";obp="1";rmf=1;; e ) cdn_1="0";cdn_0="1";obp="1";rmf=1;; f ) cdn_1="1";cdn_0="1";obp="1";rmf=1;; * ) cdn_1="0";cdn_0="0";obp="0";rmf=0;; esac cap_dev_n=$(($cdn_1*2+$cdn_0)) cap_dev=/dev/video$cap_dev_n if [ $cap_dev_n = 0 ];then p_cap_dev_n="" else p_cap_dev_n=$cap_dev_n fi fi if [ "$dev_rc_err" ];then echo "$dev_rc_errは不正なデバイスです。キャプチャデバイスは/dev/video0に再設定されています。
" fi fi vs_s=`ping -q -w 1 -c 1 $vs_name >/dev/null 2>&1;echo $?` if [ "$vs_s" = 0 ];then if [ $vs_hn = localhost ]||[ $vs_hn_addr = $exe_hn_addr ];then ma_df0=`df -m $ma_h|tail -n1|tr -s ' ' ' '` ma_df4=`echo $ma_df0|cut -d' ' -f4` #現在の空き容量 ma_df2=`echo $ma_df0|cut -d' ' -f2` #総容量 ma_fm=`du -xmsL $ma_h|tail -n 1|cut -f1` #現在の使用量 ma_ss=$(($ma_df4+$ma_fm)) vs_sleep_m=${sleep_m:-10} vs_f_list="`ls $ma_h`" dss="meta pdss=\"$ma_fm/$ma_ss $ma_df4\" \"$vs_f_list\"" vs_res=0 self_run=1 sudo_list=`sudo -l -S</dev/null`;vs_res=$? dss=`echo $dss|awk 'BEGIN{FS="<"}{print $NF}'` if [ $menat_h_t/sad_ok.$vs_hn ];then sad_ok=1 else sad_ok=0 fi fi if [ "$vs_res" = 0 ];then dss_t=`echo $dss|cut -d'"' -f2|cut -d" " -f1` p_dss="$dss_t ***
" echo -n `date '+%m/%d %H:%M'` >$ma_htmdss echo " $dss" >>$ma_htmdss dss1=`echo $dss_t|cut -d'/' -f1`;dss2=`echo $dss_t|cut -d'/' -f2` dssr=$(($dss2-$dss1)) cap_v=`grep -c on_cap $ma_htmdss` if [ $ma_run = 1 ];then p_vs_st="capturing now" fdc=" font-weight: bold; color: $cap_rgb;" else fdc=" font-weight: bold; color: $run_rgb;" p_vs_st="running" fi if [ ${dssr:-$ds_wrn} -lt $ds_wrn ];then d_shartage=1 fdc_w="
*** DISK SPACE WARNING ***" else fdc_w=" ***" fi pvs_s=" *** the video server $vs_hn is $p_vs_st * $dss_t$fdc_w" fi else sad_ok=0 fi ################################################################################################## ################################################################################################## ################################################################################################## ################################################################################################## ################################################################################################## ################################################################################################## if [ `echo "$vs_ls"|grep -c $exe_hn` != 0 ]&&[ $ma_run_ex_host = 1 ]&&[ ${cap_ign_host:-0} != 1 ];then echo "
This video server is capturing now.
Other services are ristricted strictly.

" for t in $org_menat_lock/* ;do sed 's/$/
/' $t echo "
" done echo "index.html" echo " disk space information" echo " ヘルプ

$web_version " date echo '
' exit 0 fi if [ "$vs_res" != 0 ];then if [ "$vs_s" = 0 ];then fdc=" font-weight: bold; color: $unk_rgb;" pvs_s=" *** the video server $vs_hn is running, but detail unknown ***" elif [ -f $menat_h_t/vs.html ];then dpv=`grep '(MB)' $menat_h_t/vs.html|cut -d'(' -f1` dpv1=${dpv%/*};dpv2=${dpv#*/} if [ `n_ident $dpv1` = unknown ]||[ `n_ident $dpv2` = unknown ];then dssr=unknown else dssr=$(($dpv2-$dpv1)) fi org_LANG=$LANG;LANG=C t_off_YmdHM=`ft_date $menat_h_t/vs.html 1`;LANG=$org_LANG if [ ${dssr:-unknown} = unknown ];then fdc=" font-weight: bold; color: $unk_rgb;" fdc_w=" ***
*** disk space UNKNOWN" elif [ ${dssr:-$ds_wrn} -lt $ds_wrn ];then fdc=" font-weight: bold; color: $fr_rgb;" fdc_w=" ***
*** disk space WARNING" else fdc=" font-weight: bold; color: $off_rgb;" fi dss_t=`grep 残り $menat_h_t/vs.html|head -n 1|cut -d'(' -f1` pvs_s=" *** the video server $vs_hn was turned off * $t_off_YmdHM $dss_t$fdc_w ***" else fdc=" font-weight: bold; color: $unk_rgb;" pvs_s=" *** the video server $vs_hn is turned off, detail unknown ***" fi fi if [ "$wol_rtm" ];then if [ "`cat $ma_htwol`" != $wol_rtm ];then echo $wol_rtm >$ma_htwol if [ -x $menat_bin/menat-wol.sh ];then echo "
" if [ "$vs_s" = 0 ];then echo " $vs_hnは稼働しています。
" else $menat_bin/menat-wol.sh -F -h $vs_hn -u "$ma_user@$ma_host";wol_v=$? if [ ${wol_v:-1} = 0 ];then echo " WOLで起動しました。
" else echo " WOLでの起動に失敗しました。
" fi fi echo "
" fi fi fi if [ ! "$past" ]||[ "$past" != 1 ];then job_st="style=\"text-decoration: none;\"" lock_tab=`grep -H "^compress entry " $menat_h_t/lock.*|sort -k3|cut -d":" -f1` if [ -d $menat_lock ];then lock_tab="$lock_tab $menat_lock" fi for t in $lock_tab ;do if [ $t = $menat_lock ];then if [ -d $menat_lock ];then cap_dir_ls="$menat_lock/*" else cap_dir_ls=$t fi for t_cap in $cap_dir_ls ;do cap_id=`head -n1 $t_cap`;cap_id1=${cap_id##* } cap_dd=`head -n1 $t_cap|cut -d' ' -f6|cut -d':' -f1` if [ `grep -c ':end$' $t_cap` = 1 ]&&[ `grep -c ':cap_v=0:end$' $t_cap` = 0 ] ;then cap_ls="
capture of $cap_dd failed. now waiting end time over." cap_ls="$cap_ls" else cap_ls="
now capturing $cap_dd" cap_ls="$cap_ls" fi exe_cap_f=0 if [ "$cap_id1" ];then for t in `ls $menat_h/${cap_id1}.w*.mtq 2>/dev/null` ;do if [ `grep -c "/$cap_dd\$" $t` != 0 ];then cap_fpn=${t##*/} cap_title=`$t -c iepg_title` if [ "$cap_title" ];then href_title="title=\"$cap_title\"" fi exe_cap_f=1 break else continue fi done if [ $exe_cap_f = 1 ];then cap_href="href=\"$ma_ls?vs_hn=$vs_hn&fpn=$cap_fpn\" $href_title" cap_status="${cap_status}$cap_ls" else cap_status=${cap_status}$cap_ls fi else cap_status=${cap_status}$cap_ls fi done elif [ `grep -c menat_cmp_id $t` != 0 ];then cmp_dd=`grep '^compress ' $t|tail -n1` cmp_dd=${cmp_dd##* } cmp_dd=${cmp_dd%.} cmp_ls="
now compressing $cmp_dd" cmp_id=`grep menat_cmp_id $t|cut -d' ' -f2` cmp_ls="$cmp_ls" if [ -f $menat_h_t/$cmp_id ];then cmp_title=`$menat_h_t/$cmp_id -c iepg_title` if [ "$cmp_title" ];then href_title="title=\"$cmp_title\"" fi cmp_href="href=\"$ma_ls?vs_hn=$vs_hn&past=1&past2=tmp&fpn=$cmp_id\" $href_title\"" cmp_status="${cmp_status}$cmp_ls" else cmp_status=${cmp_status}$cmp_ls fi elif [ -f "$t" ];then rex0=${t##*/} rex1=${rex0#lock.} wt_dd=`grep ^$rex1 $t|cut -d':' -f1` wt_dd=${wt_dd%.} if [ "$wt_dd" ];then p_wt_dd=$wt_dd else p_wt_dd=$rex1 fi wt_ls="
waiting to compress $p_wt_dd" wt_rex=${t##*/} wt_cmp_id=`grep ^${wt_rex#lock.} $t|cut -d':' -f8` wt_ls="$wt_ls" if [ -f $menat_h_t/$wt_cmp_id ];then wt_title=`$menat_h_t/$wt_cmp_id -c iepg_title` if [ "$wt_title" ];then href_title="title=\"$wt_title\"" fi wt_href="href=\"$ma_ls?vs_hn=$vs_hn&past=1&past2=tmp&fpn=$wt_cmp_id\" $href_title" wt_status="${wt_status}$wt_ls" else wt_status=${wt_status}$wt_ls fi fi done ma_job="$cap_status$cmp_status$wt_status" ############################################################# ######################## start ########################## ################### first critical error #################### ############################################################# if [ -f $menat_h_t/shut_al ]&&[ $vs_s = 0 ];then shut_al="now in shutdown process." fi echo "
`date '+%Y年 %-m月%_d日 %a曜日 %H:%M JST'` $shut_al
$pvs_s$ma_job
" ################################################# ################### for iepg #################### ################################################# if [ "$iepg" = 1 ]&&[ -f $menat_iepg/ch.list ];then echo "
iEPG
" if [ "$st_uri" ];then st_str_org=`grep 'station: ' $menat_iepg_f|cut -d' ' -f2` echo "station: $st_str_org" else grep 'station: ' $menat_iepg_f fi echo "
" iepg_ttl=`grep program-title: $menat_iepg_f` echo "$iepg_ttl
" iepg_sbt=`grep program-subtitle: $menat_iepg_f` if [ "$iepg_sbt" ];then echo "$iepg_sbt
" fi iepg_tail1=`grep -v ': ' $menat_iepg_f |tail -n1` iepg_opt_str=`echo "$iepg_tail1"|sed 's/」/」 /g;s/「/ 「/g;s/(終)/ (終) /g'` iepg_ext=`grep ^Extend: $menat_iepg_f` iepg_ext_v=`grep ^Extend: $menat_iepg_f|tail -n1|cut -d' ' -f2` iepg_dsp=`grep ^description: $menat_iepg_f` iepg_pfm=`grep ^performer: $menat_iepg_f` if [ ${iepg_ext_v:-0} != 0 ];then p_iepg_ed_HM=`grep ^end: $menat_iepg_f|cut -d' ' -f2` fi for t in $iepg_opt_str ;do case $t in 「S」 ) iepg_opt="$iepg_opt STEREO" ;; 「字」 ) iepg_opt="$iepg_opt 文字多重" ;; 「E」 ) iepg_opt="$iepg_opt 二ヵ国語" ;; 「再」 ) iepg_opt="$iepg_opt 再放送" ;; 「N」 ) iepg_opt="$iepg_opt NEWS" ;; 「多」 ) iepg_opt="$iepg_opt 音声多重" ;; 「新」 ) iepg_opt="$iepg_opt 新番組" ;; 「天」 ) iepg_opt="$iepg_opt 天気予報" ;; (終) | 「終」 ) iepg_opt="$iepg_opt 最終回" ;; * ) ext_str_fin="$ext_str_fin $t" ;; esac done if [ ${iepg_ext_v:-0} != 0 ];then echo "$iepg_ext
" fi if [ "$iepg_dsp" ];then echo "" echo "$iepg_dsp
" echo "
" fi if [ "$iepg_pfm" ];then echo "$iepg_pfm
" fi if [ "$iepg_opt" ];then echo "$iepg_opt
" fi if [ "$iepg_tail1" ]&&[ "$ext_str_fin" ];then echo "" echo "${ext_str_fin# }
" echo "
" fi if [ ${iepg_ext_v:-0} != 0 ];then pp_YmdHM="$st_et_Ymd ${t_end#* }" ext_p_et=`date -d "$pp_YmdHM ${iepg_ext_v:-0}minute" '+%H:%M'` ext_et_YmdHM=`date -d "$pp_YmdHM ${iepg_ext_v:-0}minute" '+%Y%m%d%H%M'` echo " *** この番組は、${iepg_ext_v}分の範囲で放映時刻が延長または変更される可能性があります。***
終了時刻設定 ${t_end#* } ${tlong}分
延長対応終了時刻 $ext_p_et $(($tlong+${iepg_ext_v:-0}))分
" fi echo "

" elif [ "$iepg" = 2 ];then echo "
iEPG ERROR
iEPGファイルが見つかりません。

" elif [ "$iepg" = 3 ];then echo "
iEPG ERROR
壊れたiEPGファイルです。

" fi ################################################## ################ remove program ################# ################################################## if [ "$ma_rm" ];then if [ `grep -c ^0$prmt $ma_htrm` = 0 ];then echo 0$prmt >>$ma_htrm ln_keeper $ma_htrm rm_Ymd=${ma_rm:0:8} rm_H=${ma_rm:8:2} rm_M=${ma_rm:10:2} ma_rm_org=$ma_rm ma_rm_12=${ma_rm_org%.*.mtq} rm_cap_dev=${ma_rm:14:1} case $rm_cap_dev in '.' ) rm_2p="" ;rm_cap_dev=0;; * ) rm_2p=$rm_cap_dev ;; esac if [ ! -f $menat_h/$ma_rm ];then if [ -f $menat_h/$ma_rm_12.w$rm_2p.mtq ];then ma_rm=$ma_rm_12.w$rm_2p.mtq fi fi echo "

" pch=`$menat_h/$ma_rm -c pch` rm_pch=`$menat_h/$ma_rm -c ch` rm_input_v=`$menat_h/$ma_rm -c input_v` if [ "$pch" = v ];then pch=Composite1 elif [ "$pch" = s ];then pch=S-Video fi epm=`$menat_h/$ma_rm -c time_epm` pf_name=`$menat_h/$ma_rm -c name_f` pf_name=${pf_name##*/} popt=`$menat_h/$ma_rm -c opt1` if [ "$popt" ];then pf_name=$pf_name:$popt fi prj="`date -d $rm_Ymd '+%Y年 %-m月%_d日 %a曜日'` $rm_H:$rm_M $epm分 $pch $pf_name" ss="録画予約設定" if [ -f $menat_h/$ma_rm ];then ma_rm_owner=`$menat_h/$ma_rm -c menat_user` cap_ev=`grep -c 'menat_que_record$' $menat_h/$ma_rm` if [ $ma_run = 1 ]&&[ -f $menat_h/$ma_rm ];then if [ -f $menat_lock ];then cap_dd=`cat $menat_lock` cap_YmdHM=${cap_dd## } dvn=`n_ident $cap_YmdHM`;dvn_v=$? if [ ${#cap_YmdHM} != 12 ]||[ $dvn_v != 0 ];then cap_YmdHM=`date -d "${cap_dd%% }" '+%Y%m%d%H%M'` fi if [ ${ma_rm:0:12} = $cap_YmdHM ];then on_cap=1 else on_cap=0 fi elif [ -d $menat_lock ];then ma_rm_bfn=`$menat_h/$ma_rm -c bfn` if [ -f $menat_lock/$ma_rm_bfn ];then on_cap=1 else on_cap=0 fi fi else on_cap=0 fi cap_rm_v=`grep -c ^ex_sleep= $menat_lock/$ma_rm_bfn` if [ $on_cap = 1 ]&&[ ${cap_rm_v:-0} = 0 ];then echo "キャプチャ中には実行できない操作です。" elif [ "$ma_rm_owner" = "$ma_user" ]||[ "$admin_v" = 0 ];then echo >>$menat_h/$ma_rm lang_t=$LANG;LANG=C LANG=$lang_t rn=1 cap_rn=${rm_cap_dev#/dev/video} if [ ${cap_rm_v:-0} = 0 ];then rm_exe_v=`$rm_to_f -c exe_v` rm_exe_nv=$((${rm_exe_v:-0}-4)) rm_to_f=$menat_h_t/$ma_rm_12.$cap_rn$rn.mtq else rm_exe_nv=4 if [ $cap_rn = 0 ];then rm_cap_rn="" else rm_cap_rn=$cap_rn fi rm_to_f=$menat_h_t/$ma_rm_12.f$rm_cap_rn.mtq fi while [ -f $rm_to_f ];do if [ $rn -ge 255 ];then while [ $rn != 0 ];do mv -f $rm_to_f $menat_h_t/$ma_rm_12.$cap_rn$(($rn-1)).mtq rn=$(($rn-1)) done rn=255 break fi rn=$(($rn+1)) rm_to_f=$menat_h_t/$ma_rm_12.$cap_rn$rn.mtq done cp -f $menat_h/$ma_rm $rm_to_f;rm_v=$? rm_err_0="mv -f $menat_h/$ma_rm $rm_to_f;rm_v=$rm_v" if [ -f $rm_to_f ];then ed -s $rm_to_f >/dev/null 2>&1 </;2,$p'` rm_ch=`$rm_to_f -c ch` iepg_web_str=`grep ch$rm_ch $menat_iepg/ch.list|cut -d':' -f2` iepg_stn_str=`echo "$rm_iepg_dd0"|head -n1|cut -d' ' -f2` iepg_stn_uri=`grep ch$rm_ch $menat_iepg/ch.list|cut -d':' -f6` st_uri="http://$iepg_stn_uri/" if [ "$st_uri" ];then iepg_stn="station: $iepg_stn_str" else iepg_stn="station: $iepg_stn_str" fi rm_iepg_dd="$iepg_stn $rm_iepg_dd1
" echo "
" echo "" echo "$rm_iepg_err$rm_iepg_dd" echo "" fi echo \#`date '+%Y-%m-%d %a %H:%M,'` this program was removed by $ma_user.>>$rm_to_f rm_week=`$rm_to_f -c week` if [ ${rm_week:-0} = 0 ];then rm_week="" fi elif [ "$on_cap" = 1 ];then echo " $prj *** この$ssは現在キャプチャ中により削除できません。" elif [ "$per_v" = 1 ];then echo " $prj *** この$ssに対するパーミッションがありません。" else echo " $prj *** この$ssを取り消すことができませんでした。" fi else echo "$prj *** この$ssはすでに取り消されています。" fi echo "
" fi else echo "$w_nt" >/dev/null fi ################################################################### ################################################################### ################### start time fatal error #################### ################################################################### ################################################################### echo "
" wrn_nn=0 ls_v2=`ls $menat_h/$start_t.[nwW]*.mtq 2>/dev/null` if [ "$ls_v2" ]&&[ ! "$ma_rm" ]&&[ "$act" = 1 ];then for t in $ls_v2 ;do ex_cap_dev=`$t -c cap_dev` if [ ${ex_cap_dev:-/dev/video0} = $cap_dev ];then st_err=1 err=1 else wrn_nn=$(($wrn_nn+1)) fi re_err_l=$t done if [ "$st_err" = 1 ];then echo "
同一開始時刻の予約があります。" else echo "
同一開始時刻の予約があります。
" pre_wrn=1 fi fi dd_Ymd=`date '+%Y%m%d'` dd_md=`date -d '1 days' '+%m月%d日'` dd_HM=`date '+%H%M'` if [ "$act" = 1 ]||[ "$maexe" ];then act=1 if [ "$m_v" ];then if [ ! "$start_t" ];then echo "
録画開始時刻が指定されていません。" t_err=1 err=1 elif [ "$t_err" = 1 ]||[ "$thm_err" = 1 ]||[ "$Ymd_err" = 1 ];then echo "
録画開始時刻の指定が不正な値です。" t_err=1 err=1 elif [ $start_t '<' $w_nt ]||[ $start_t = $w_nt ];then echo "
過去に対する予約です。" tp_err=1 err=1 elif [ "$ovt_err" = 1 ];then echo "
いわゆる2038年問題が存在します。" tp_err=1 t_err=1 err=1 fi fi if [ "$tl_err" = 1 ]&&[ "$m_v" ];then if [ ! "$tlong" ];then echo "
録画時間が指定されていません。" else if [ $tlong = iepg_auto ];then echo "
iEPGデータの取得に失敗しました。" else echo "
録画時間の指定が不正な値です。" fi fi err=1 elif [ "$tlong" -le 0 ];then echo "
録画時間の指定が負値です。" err=1 tl_err2=1 elif [ "$tlong" -gt 600 ];then echo "
十時間を越える録画には対応できません。" err=1 tl_err2=1 fi if [ "$ch_err" = 1 ]&&[ "$m_v" ]&&[ ! "$ch" ];then echo "
チャンネルが指定されていません。" err=1 elif [ "$ch_err" = 1 ]&&[ "$m_v" ]&&[ "$ch" ];then echo "
チャンネルの指定が不正な値です。" err=1 fi if [ "$f_err" = 1 ]&&[ "$m_v" ];then if [ "$of_err" = 1 ];then echo "
オプションの指定に誤りがあります。" else echo "
ファイル名が指定されていません。" fi err=1 fi if [ ${opf_name%.$ma_ext} = menat ]||[ ${opf_name%.$ma_ext} = tmp ];then echo "
$opf_nameをファイル名に用いることはできません。" fl_wrn=1 f_err=1 fn_err=1 err=1 re_err_l="$t2 $re_err_l" fi if [ ${err:-0} = 1 ];then fatal_err_br=1 echo "

" elif [ "$act" = 1 ]&&[ "$maexe_reload" != 1 ];then echo "
" fi fi echo "
" ###################################### ############ WRNNING ############### ###################################### if [ "$act" = 1 ];then echo "
" if [ "$start_t" '>' $w_nt ]&&[ "$start_t" '<' `date -d 1hour '+%Y%m%d%H%M'` ]&&[ "$m_v" ];then nx_tM=${start_t:10:2} tt_M=${w_nt:10:2} nx_tM_n=${nx_tM#0};tt_M_n=${tt_M#0} if [ $nx_tM_n -gt $tt_M_n ];then nx_exe_t=$(($nx_tM_n-$tt_M_n)) else nx_exe_t=$((60+$nx_tM_n-$tt_M_n)) fi # echo "
" wrn_1_br=1 if [ $vs_s = 0 ];then if [ "$self_run" != 1 ];then vs_sleep_m=`grep ^sleep_m= $menat_h_t/mdss_3|cut -d'=' -f2` fi echo "録画開始時刻が${nx_exe_t}分後に迫っています。予約時刻、時間を確認の上、登録してください。現在の予約登録間隔は、${vs_sleep_m:-?}分です。" if [ "$vs_s" = 0 ]&&[ "$ma_user" != guest ]&&[ "$past" != 1 ];then if [ $sad_ok = 1 ];then echo "または予約登録後、予約登録の更新を手動で実行してください。" fi fi echo "
" else echo "録画開始時刻が${nx_exe_t}分後に迫っています。現在、ビデオサーバ${vs_hn}は停止中です。予約時刻、時間を確認の上、登録してください。
" fi ot_wrn=1 wrn_nn=$(($wrn_nn+1)) echo "
" fi if [ "$t_err" != 1 ]&&[ "$st_st_Ymd" '>' `date -d '1 month' '+%Y%m%d'` ]&&[ "$m_v" ];then if [ "$ovt_err" != 1 ];then echo "一ヶ月以上先の期日が指定されています。予約時刻、時間を確認してください。

" ot_wrn=1 wrn_nn=$(($wrn_nn+1)) fi fi if [ "$ch_wrn" = 1 ];then echo "チャンネルの設定値が不正である可能性があります。確認してください。

" wrn_nn=$(($wrn_nn+1)) else echo $ch >$ma_htchsl fi if [ "$opf_name" ];then for t in `grep -Hc /$opf_name\$ $menat_h/*.mtq|grep -v ':0$'` ;do t1=${t##*:} if [ $t1 = 0 ];then continue else t2=${t%:*} if [ "$mesg_n" != 1 ];then echo "登録済録画予約中にファイル名が重複している予約があります。

" fi mesg_n=1 fl_wrn=1 db_er_fn=$opf_name re_err_l="$t2 $re_err_l" wrn_nn=$(($wrn_nn+1)) fn_bb=1 fi done if [ "$f_opt" ];then fmt_1=${f_opt:0:1} case $fmt_1 in [Ww] ) cmp_ext=wmv ;; [xXvVmM] ) cmp_ext=mpg ;; [0-8] ) cmp_ext=wmv ;; [a-qz]|[A-HZ] ) cmp_ext=mpg ;; * ) cmp_ext=$ma_ext ;; esac else cmp_ext=$ma_ext fi ft=`grep -c $opf_name $menat_h_t/ma_h.db` ft2=`grep -c ${opf_name%$ma_ext}$cmp_ext $menat_h_t/ma_h.db` if [ $ft != 0 ];then if [ "$vs_s" != 0 ];then echo "ビデオサーバ上に同名のファイル($opf_name)が既に存在する可能性があります。

" fl_wrn=1 wrn_nn=$(($wrn_nn+1)) else echo "ビデオサーバ上に同名のファイル($opf_name)が既に存在します。

" fl_wrn=1 wrn_nn=$(($wrn_nn+1)) fi fn_bb=1 fi if [ $ft2 != 0 ];then if [ "$vs_s" != 0 ];then echo "ビデオサーバ上に同名の圧縮ファイル(${opf_name%$ma_ext}$cmp_ext)が既に存在する可能性があります。

" fl_wrn=1 wrn_nn=$(($wrn_nn+1)) else echo "ビデオサーバ上に同名の圧縮ファイル(${opf_name%$ma_ext}$cmp_ext)が既に存在します。

" fl_wrn=1 wrn_nn=$(($wrn_nn+1)) fi fn_bb=1 fi else if [ ! "$kousin" ];then err=1 fi fi echo '
' echo "
" ni=1;nk=0 for ff in `ls $menat_h/*.mtq` in;do if [ ! "$m_v" ]||[ "$t_err" = 1 ]||[ "$tp_err" = 1 ]||[ "$tl_err2" = 1 ];then break fi ma_st_org=${ff##*/} ma_st_YmdHM=${ma_st_org%%.*mtq} tn_fn=`$ff -c bfn` rt_fv="";rt_fv0="";rt_fv1="" ex_cap_dev=`$ff -c cap_dev` ex_cap_dev=${ex_cap_dev:-/dev/video0} if [ $ex_cap_dev != $cap_dev ];then cap_dev_ok=1 else cap_dev_ok=0 fi if [ -d $ff ]||[ $ma_st_YmdHM = "$start_t" ]||[ ${#ma_st_YmdHM} != 12 ];then continue fi dvn=`n_ident $ma_st_YmdHM`;dvn_v=$? if [ $dvn_v != 0 ]||[ "$tl_err" = 1 ];then continue elif [ $cap_dev_ok = 0 ];then ma_et_YmdHM=`grep TIME_END $ff|tail -n1` ma_et_YmdHM=${ma_et_YmdHM##*=};ma_et_YmdHM=${ma_et_YmdHM%% *} rt_ma_wv=`$ff -c week` rt_ma_wv=${rt_ma_wv:-0} rt_st_wv=${rt_v:-0} st_st_w=`date -d $st_st_Ymd '+%w'` st_st_HM=$st_st_H$st_st_M st_st_wHM=$st_st_w$st_st_HM st_et_Ymd=${st_et_YmdHM:0:8} st_et_w=`date -d $st_et_Ymd '+%w'` st_et_HM=${st_et_YmdHM:8:4} if [ $st_st_w = 6 ]&&[ $st_et_w = 0 ];then st_et_w=7 fi st_et_wHM=$st_et_w$st_et_HM if [ $st_st_Ymd != $st_et_Ymd ];then t_abs_1HM=$((1$st_et_HM+2400)) else t_abs_1HM=1$st_et_HM fi ma_st_Ymd=${ma_st_YmdHM:0:8} ma_st_w=`date -d $ma_st_Ymd '+%w'` ma_st_HM=${ma_st_YmdHM:8:4} ma_st_wHM=$ma_st_w$ma_st_HM ma_et_Ymd=${ma_et_YmdHM:0:8} ma_et_w=`date -d $ma_et_Ymd '+%w'` ma_et_HM=${ma_et_YmdHM:8:4} if [ $ma_st_w = 6 ]&&[ $ma_et_w = 0 ];then ma_et_w=7 fi ma_et_wHM=$ma_et_w$ma_et_HM if [ $ma_st_Ymd != $ma_et_Ymd ];then a_abs_1HM=$((1$ma_et_HM+2400)) else a_abs_1HM=1$ma_et_HM fi if [ ! $st_st_YmdHM '>' $ma_et_YmdHM ]&&[ ! $ma_st_YmdHM '>' $st_et_YmdHM ];then pp_ch=`$ff -c ch` if [ $pp_ch = v ];then pp_ch="Composite1" elif [ $pp_ch = s ];then pp_ch="S-Video" else pp_ch=${pp_ch}ch fi pp_fn=`$ff -c bfn` pp_Ymd=${ma_st_YmdHM:0:8} pp_epm=`$ff -c time_epm` pp_opt=`$ff -c opt1` if [ "$pp_opt" ];then pp_opt=:$pp_opt fi pp_H=${ma_st_YmdHM:8:2};pp_M=${ma_st_YmdHM:10:2} pe_H=${ma_et_YmdHM:8:2};pe_M=${ma_et_YmdHM:10:2} if [ $ma_st_Ymd = $ma_et_Ymd ];then tom="" elif [ `date -d "$ma_st_Ymd 1day" '+%Y%m%d'` = $ma_et_Ymd ];then tom="翌 " else to="" tom_over=1 fi ma_st_YmdHM_p="`date -d $pp_Ymd '+%Y年 %-m月%_d日 %a曜日'` $pp_H:$pp_M" ma_et_HM_p="$pe_H:$pe_M" g_pb_err=1 if [ $st_st_YmdHM != $ma_et_YmdHM ]&&[ $ma_st_YmdHM != $st_et_YmdHM ];then err=1 pb_err=1 pg_err_p1="" pg_err_p2="" else wrn_nn=$(($wrn_nn+1)) wrn=1;nk=$(($nk+1)) fi tom_end=$tom$ma_et_HM_p if [ "$maexe" ];then if [ ${pb_err:-0} = 1 ];then if [ ${wrn_1_br:-0} != 1 ];then echo "
" wrn_1_br=1 fi echo "${pg_err_p1}この録画予約の設定は、下記の予約と重なっています。予約時刻、 時間を確認してください。
開始時刻:$ma_st_YmdHM_p 終了時刻 $tom_end 録画時間 ${pp_epm}分 $pp_ch $pp_fn$pp_opt${pg_err_p2}

" fi else echo "${pg_err_p1}この録画予約の設定は、下記の予約と重なっています。予約時刻、 時間を確認してください。
開始時刻:$ma_st_YmdHM_p 終了時刻 $tom_end 録画時間 ${pp_epm}分 $pp_ch $pp_fn$pp_opt${pg_err_p2}

" fi bx_l="$bx_l $ma_st_org" continue fi fi ################################## file name batting ############################ bb_ext=${opf_name##*.};bb_nn=`echo $opf_name|cut -d'.' -f2`;bb_b=${opf_name%.*.$ma_ext} tn_ext=${tn_fn##*.};tn_nn=`echo $tn_fn|cut -d'.' -f2`;tn_b=${tn_fn%.*.$ma_ext} if [ "$bb_b" = "$tn_b" ];then tmp1_bb_nn=$bb_nn tmp1_tn_nn=$tn_nn while [ loop ];do tmp0_bb_nn=$tmp1_bb_nn tmp1_bb_nn=${bb_nn#0} if [ "$tmp0_bb_nn" = 0 ]||[ "$tmp1_bb_nn" = "$tmp0_bb_nn" ];then break fi done while [ loop ];do tmp0_tn_nn=$tmp1_tn_nn tmp1_tn_nn=${tn_nn#0} if [ "$tmp0_tn_nn" = 0 ]||[ "$tmp1_tn_nn" = "$tmp0_tn_nn" ];then break fi done dvn=`n_ident $tmp0_bb_nn`;bb_nn_v=$? dvn=`n_ident $tmp0_tn_nn`;tn_nn_v=$? if [ $bb_nn_v = 0 ]&&[ $bb_nn_v = 0 ];then if [ "$bb_ext" = $ma_ext ]&&[ "$tn_ext" = $ma_ext ];then if [ $cap_dev_ok = 1 ];then rt_st_wv=${rt_v:-0} rt_ma_wv=`$ff -c week` rt_ma_wv=${rt_ma_wv:-0} fi if [ $rt_st_wv != 0 ]&&[ $rt_ma_wv != 0 ];then if [ "$bb_b" = "$tn_b" ];then fn_rt_err=1 fi elif [ $rt_st_wv = 0 ]&&[ $rt_ma_wv = 0 ];then if [ $tmp0_bb_nn '>' $tmp0_tn_nn ];then fn_rt_err=1 fi elif [ $rt_st_wv = 0 ]&&[ $rt_ma_wv = 0 ];then if [ $tmp0_bb_nn '<' $tmp0_tn_nn ];then fn_rt_err=1 fi fi fi fi if [ "$fn_rt_err" = 1 ]&&[ "$fn_bb" != 1 ];then echo "録画予約の自動更新により、将来、ファイル名が重複する録画予約が存在します。
$tn_fn

" fl_wrn=1 db_er_fn=$tn_fn re_err_l="$ff $re_err_l" wrn_nn=$(($wrn_nn+1)) frt_err=0 fi fi ############################################################################################## ############################ capture time batting in future ################################## if [ $cap_dev_ok = 0 ];then if [ ${rt_st_wv:-0} != 0 ]||[ ${rt_ma_wv:-0} != 0 ];then if [ $rt_st_wv = p ]&&[ $st_st_w = 0 -o $st_st_w = 6 ];then if [ $ma_st_YmdHM '>' $st_et_YmdHM ]||[ $ma_st_YmdHM = $st_et_YmdHM ];then rt_fv=2 fi elif [ $rt_ma_wv = p ]&&[ $ma_st_w = 0 -o $ma_st_w = 6 ];then if [ $st_st_YmdHM '>' $ma_et_YmdHM ]||[ $st_st_YmdHM = $ma_et_YmdHM ];then rt_fv=2 fi fi if [ $rt_st_wv = 0 ];then if [ $ma_st_YmdHM '>' $st_et_YmdHM ]||[ $ma_st_YmdHM = $st_et_YmdHM ];then rt_fv=0 fi elif [ $rt_ma_wv = 0 ];then if [ $st_st_YmdHM '>' $ma_et_YmdHM ]||[ $st_st_YmdHM = $ma_et_YmdHM ];then rt_fv=0 fi fi if [ $rt_fv = 0 ];then rt_fv0=0 rt_fv1=0 elif [ $rt_ma_wv = d -o $rt_ma_wv = p ]||[ $rt_st_wv = d -o $rt_st_wv = p ];then if [ 1$st_st_HM '>' $a_abs_1HM ]||[ 1$ma_st_HM '>' $t_abs_1HM ];then if [ 1$st_st_HM '<' 1$ma_st_HM ]||[ 1$st_st_HM = 1$ma_st_HM ];then dst_1HM=$((1$st_st_HM+2400)) dst_abs_1HM=$(($t_abs_1HM+2400)) if [ $dst_1HM = $a_abs_1HM ]||[ 1$ma_st_HM = $dst_abs_1HM ];then rt_fv0=0 elif [ $dst_1HM '>' $a_abs_1HM ]||[ 1$ma_st_HM '>' $dst_abs_1HM ];then rt_fv0=0 else if [ $rt_st_wv = p ]&&[ $rt_ma_wv = p ];then rt_fv0=1 elif [ $rt_st_wv = p ];then if [ $ma_st_w = 0 -o $ma_st_w = 6 ];then rt_fv0=0 else rt_fv0=1 fi elif [ $rt_ma_wv = p ];then if [ $st_st_w = 0 -o $st_st_w = 6 ];then rt_fv0=0 else rt_fv0=1 fi fi fi else dsa_1HM=$((1$ma_st_HM+2400)) dsa_abs_1HM=$(($a_abs_1HM+2400)) if [ 1$st_st_HM = $dsa_abs_1HM ]||[ $dsa_1HM = $t_abs_1HM ];then rt_fv0=0 elif [ 1$st_st_HM '>' $dsa_abs_1HM ]||[ $dsa_1HM '>' $t_abs_1HM ];then rt_fv0=0 else if [ $rt_st_wv = p ]&&[ $rt_ma_wv = p ];then rt_fv0=1 elif [ $rt_st_wv = p ];then if [ $ma_st_w = 0 -o $ma_st_w = 6 ];then rt_fv0=0 else rt_fv0=1 fi elif [ $rt_ma_wv = p ];then if [ $st_st_w = 0 -o $st_st_w = 6 ];then rt_fv0=0 else rt_fv0=1 fi fi fi fi elif [ $rt_st_wv = d ]||[ $rt_ma_wv = d ];then rt_fv0=1 elif [ $rt_st_wv = p ]&&[ $rt_ma_wv = p ];then rt_fv0=1 elif [ $rt_st_wv = p ];then if [ $ma_st_w = 0 -o $ma_st_w = 6 ];then rt_fv0=0 else rt_fv0=1 fi elif [ $rt_ma_wv = p ];then if [ $st_st_w = 0 -o $st_st_w = 6 ];then rt_fv0=0 else rt_fv0=1 fi else rt_fv0=1 fi fi if [ "$rt_fv" != 2 ];then if [ ! $rt_st_wv = d -o $rt_st_wv = p ]&&[ ! $rt_ma_wv = d -o $rt_ma_wv = p ];then if [ ! 1$st_st_wHM '>' 1$ma_et_wHM ]&&[ ! 1$ma_st_wHM '>' 1$st_et_wHM ];then rt_fv1=1 else if [ 1$st_st_wHM '>' 1$ma_st_wHM ];then n_ma_st_wHM=$((1$ma_st_wHM+70000)) n_ma_et_wHM=$((1$ma_et_wHM+70000)) n_st_st_wHM=1$st_st_wHM n_st_et_wHM=1$st_et_wHM else n_ma_st_wHM=1$ma_st_wHM n_ma_et_wHM=1$ma_et_wHM n_st_st_wHM=$((1$st_st_wHM+70000)) n_st_et_wHM=$((1$st_et_wHM+70000)) fi if [ ! $n_st_st_wHM '>' $n_ma_et_wHM ]&&[ ! $n_ma_st_wHM '>' $n_st_et_wHM ];then rt_fv1=1 else rt_fv1=0 fi fi fi fi if { [ "$rt_fv0" = 1 ]||[ "$rt_fv1" = 1 ]; }&&[ "$rt_fv" != 0 ];then pp_ch=`$ff -c ch` pp_input_v=`$ff -c input_v` if [ $pp_ch = v ];then pp_ch="Composite1" elif [ $pp_ch = s ];then pp_ch="S-Video" else if [ ${pp_input_v:-c} = v ]||[ ${pp_input_v:-c} = s ];then pp_ch=$pp_ch$pp_input_v else pp_ch=${pp_ch}ch fi fi pp_fn=`$ff -c bfn` pp_epm=`$ff -c time_epm` pp_opt=`$ff -c opt1` if [ "$pp_opt" ];then pp_opt=:$pp_opt fi pp_H=${ma_st_YmdHM:8:2};pp_M=${ma_st_YmdHM:10:2} pe_H=${ma_et_YmdHM:8:2};pe_M=${ma_et_YmdHM:10:2} if [ $ma_st_Ymd != $ma_et_Ymd ];then tom="翌 " fi ma_st_YmdHM_p2="`date -d $ma_st_Ymd '+%Y年 %-m月%_d日 %a曜日'` $pp_H:$pp_M" ma_et_HM_p2="$pe_H:$pe_M" if [ $st_st_HM != $pe_H$pe_M ]&&[ ${ma_st_YmdHM:8:4} != $st_et_HM ];then err=1 pb_err=1 g_pb_err=1 pg_err_p3="" pg_err_p4="" else wrn_nn=$(($wrn_nn+1)) wrn=1;nk=$(($nk+1)) g_pb_err=1 fi if [ "$maexe" ];then if [ ${pb_err:-0} = 1 ];then if [ ${wrn_1_br:-0} != 1 ];then echo "
" wrn_1_br=1 fi echo "${pg_err_p3} この録画予約の設定は、録画予約の自動更新により下記の予約と重なる可能性があります。 予約時刻、時間を確認してください。
開始時刻:$ma_st_YmdHM_p2 終了時刻 $tom$ma_et_HM_p2 録画時間 ${pp_epm}分 $pp_ch $pp_fn$pp_opt ${pg_err_p4}

" fi else echo "${pg_err_p3} この録画予約の設定は、録画予約の自動更新により下記の予約と重なる可能性があります。 予約時刻、時間を確認してください。
開始時刻:$ma_st_YmdHM_p2 終了時刻 $tom$ma_et_HM_p2 録画時間 ${pp_epm}分 $pp_ch $pp_fn$pp_opt ${pg_err_p4}

" fi bx_l="$bx_l $ma_st_org" fi #########################################################################################3 fi fi done echo '
' echo "
" if [ ! "$maexe" ];then if [ "$err" != 1 ]&&[ "$m_v" ];then echo " 予約登録可能です。
" yoyaku_ok=1 fi fi if [ $t_err = 0 ]&&[ ${ch_err:-0} = 0 ]&&[ $tl_err = 0 ]&&[ "$tl_err2" != 1 ]&&[ ! "$maexe" ];then if [ "$tp_err" = 1 ];then okc="" else okc=" background-color: $okbg_rgb;" fi if [ ! "$iepg" ]&&[ $ch_cs = 0 ]&&[ ${iepg_verbose:-1} = 1 ]&&[ -f $menat_iepg/ch.list ];then if [ "$pg_iepg_ok" = 1 ];then iepg_org_info=$pg_iepg_dd iepg_v1=0 else iepg_org_info=`$menat_progchk -v $vs_hn -i $start_t -c $ch`;iepg_v1=$? fi if [ $iepg_v1 != 0 ];then iepg_org_info_e1=`$menat_progchk -v $vs_hn -i $start_t -c $ch -N`;iepg_v2=$? if [ $iepg_v2 = 0 ];then iepg_Y_e1=`echo "$iepg_org_info_e1"|grep ^year:|cut -d' ' -f2` iepg_m_e1=`echo "$iepg_org_info_e1"|grep ^month:|cut -d' ' -f2` iepg_d_e1=`echo "$iepg_org_info_e1"|grep ^date:|cut -d' ' -f2` iepg_psHM_e1=`echo "$iepg_org_info_e1"|grep ^start:|cut -d' ' -f2` iepg_peHM_e1=`echo "$iepg_org_info_e1"|grep ^end:|cut -d' ' -f2` iepg_sHM_e1=`echo $iepg_psHM_e1|sed 's/://'` iepg_eHM_e1=`echo $iepg_peHM_e1|sed 's/://'` iepg_sYmd_e1=$iepg_Y_e1$iepg_m_e1$iepg_d_e1 iepg_sYmdHM_e1=$iepg_Y_e1$iepg_m_e1$iepg_d_e1$iepg_sHM_e1 iepg_psYmdHM_e1="$iepg_Y_e1-$iepg_m_e1-$iepg_d_e1 $iepg_psHM_e1" if [ $iepg_sYmdHM_e1 '<' $st_et_YmdHM ];then iepg_org_info=$iepg_org_info_e1 iepg_v=0 else iepg_v=125 fi else iepg_v=125 fi else iepg_v=0 fi if [ $iepg_v = 0 ];then if [ ${yoyaku_ok} != 1 ]&&[ ${g_pb_err:-0} = 1 ];then echo "
" fi echo "" if [ "$st_uri" ];then st_str_org=`echo "$iepg_org_info"|grep 'station: '|cut -d' ' -f2` iepg_stn="station: $st_str_org" else iepg_stn=`echo "$iepg_org_info"|grep station:` fi iepg_tail1=`echo "$iepg_org_info"|grep -v ': '|tail -n1` iepg_ttl=`echo "$iepg_org_info"|grep program-title:` iepg_sb_ttl=`echo "$iepg_org_info"|grep program-subtitle:` iepg_opt_str=`echo "$iepg_tail1"|sed 's/」/」 /g;s/「/ 「/g;s/(終)/ (終) /g'` iepg_st=`echo "$iepg_org_info"|grep ^start:|cut -d' ' -f2` iepg_et=`echo "$iepg_org_info"|grep ^end:|cut -d' ' -f2` iepg_ext=`echo "$iepg_org_info"|grep ^Extend:` iepg_ext_v=`echo "$iepg_org_info"|grep ^Extend:|tail -n1|cut -d' ' -f2` iepg_dsp=`echo "$iepg_org_info"|grep ^description:` iepg_pfm=`echo "$iepg_org_info"|grep ^performer:` for t in $iepg_opt_str ;do case $t in 「S」 ) iepg_opt="$iepg_opt STEREO" ;; 「字」 ) iepg_opt="$iepg_opt 文字多重" ;; 「E」 ) iepg_opt="$iepg_opt 二ヵ国語" ;; 「再」 ) iepg_opt="$iepg_opt 再放送" ;; 「N」 ) iepg_opt="$iepg_opt NEWS" ;; 「多」 ) iepg_opt="$iepg_opt 音声多重" ;; 「新」 ) iepg_opt="$iepg_opt 新番組" ;; 「天」 ) iepg_opt="$iepg_opt 天気予報" ;; (終) | 「終」 ) iepg_opt="$iepg_opt 最終回" ;; * ) ext_str_fin="$ext_str_fin $t" ;; esac done echo "$iepg_stn
$iepg_ttl
" if [ "$iepg_sb_ttl" ];then echo "$iepg_sb_ttl
" fi if [ ${iepg_ext_v:-0} != 0 ];then echo "$iepg_ext
" fi if [ "$iepg_dsp" ];then echo "" echo "$iepg_dsp
" echo "
" fi if [ "$iepg_pfm" ];then echo "$iepg_pfm
" fi if [ "$iepg_opt" ];then echo "$iepg_opt
" fi if [ "$iepg_tail1" ]&&[ "$ext_str_fin" ];then echo "" echo "${ext_str_fin# }
" echo "
" fi iepg_st_Y=`echo "$iepg_org_info"|grep ^year: |cut -d' ' -f2` iepg_st_m=`echo "$iepg_org_info"|grep ^month: |cut -d' ' -f2` iepg_st_d=`echo "$iepg_org_info"|grep ^date: |cut -d' ' -f2` iepg_st_Ymd=$iepg_st_Y$iepg_st_m$iepg_st_d p_iepg_st_HM=`echo "$iepg_org_info"|grep ^start: |cut -d' ' -f2` p_iepg_ed_HM=`echo "$iepg_org_info"|grep ^end: |cut -d' ' -f2` iepg_st_HM=`echo $iepg_st|sed 's/://g'` iepg_ed_HM=`echo $iepg_et|sed 's/://g'` iepg_st_s=`date -d "$iepg_st_Ymd $iepg_st" '+%s'` if [ 1$iepg_st_HM '>' 1$iepg_ed_HM ];then iepg_ed_Ymd=$(($iepg_st_Ymd+1)) else iepg_ed_Ymd=$iepg_st_Ymd fi iepg_ed_s=`date -d "$iepg_ed_Ymd $iepg_et" '+%s'` iepg_tlong=$(($(($iepg_ed_s-$iepg_st_s))/60)) if [ $iepg_st_Y$iepg_st_m$iepg_st_d$iepg_st != $st_st_Ymd$st_st_H:$st_st_M ];then if [ $iepg_st_d != $st_st_d ];then iepg_ex_d="$iepg_st_m/$iepg_st_d " fi echo " 開始時刻の設定がiEPGデータと異なります。
iEPG=$iepg_ex_d$iepg_st ${iepg_tlong}分 --- 開始時刻設定 $st_st_H:$st_st_M ${tlong}分
" iepg_s_ok=0 else iepg_s_ok=1 fi if [ ${iepg_ext_v:-0} != 0 ];then pp_YmdHM="$iepg_ed_Ymd $p_iepg_ed_HM" ext_p_et=`date -d "$pp_YmdHM ${iepg_ext_v:-0}minute" '+%H:%M'` ext_et_YmdHM=`date -d "$pp_YmdHM ${iepg_ext_v:-0}minute" '+%Y%m%d%H%M'` if [ $st_et_YmdHM '<' $iepg_ed_Ymd$iepg_ed_HM ]||[ $st_et_YmdHM = $iepg_ed_Ymd$iepg_ed_HM ];then echo " *** この番組は、${iepg_ext_v}分の範囲で放映時刻が延長または変更される可能性があります。***
" ext_et_ok=0 elif [ $st_et_YmdHM '<' $ext_et_YmdHM ];then echo " *** この番組は、${iepg_ext_v}分の範囲で放映時刻が延長または変更される可能性があります。延長に対応するならば延長時間が不足しています。***
" ext_et_ok=2 elif [ $st_et_YmdHM '>' $ext_et_YmdHM ];then echo " *** この番組は、${iepg_ext_v}分の範囲で放映時刻が延長または変更される可能性があります。延長に対応するならば延長時間が超過しています。***
" ext_et_ok=3 else echo " *** この録画予約設定は、${iepg_ext_v}分の延長対応済みです。***
" ext_et_ok=1 fi else ext_et_ok=-1 fi if [ $iepg_et != ${t_end#* } ]||[ $ext_et_ok != -1 ];then if [ ${iepg_ext_v:-0} != 0 ];then if [ $ext_et_ok = 1 ];then echo "" iepg_e_ok=3 elif [ $iepg_et = ${t_end#* } ];then echo " 延長の可能性に未対応です。
" iepg_e_ok=2 else if [ "$auto_iepg" = 1 ];then tlong=$((${iepg_tlong}+${iepg_ext_v:-0})) tl_err=0 tl_err2=0 iepg_e_ok=3 echo "" else echo " 終了時刻の設定がiEPGデータと異なります。
" iepg_e_ok=0 fi fi echo " iEPG=$iepg_et ${iepg_tlong}分 --- 終了時刻設定 ${t_end#* } ${tlong}分
延長対応終了時刻 iEPG=$ext_p_et $((${iepg_tlong}+${iepg_ext_v:-0}))分
" else if [ "$auto_iepg" = 1 ];then tlong=$((${iepg_tlong}+${iepg_ext_v:-0})) tl_err=0 tl_err2=0 iepg_e_ok=1 else echo " 終了時刻の設定がiEPGデータと異なります。
iEPG=$iepg_et ${iepg_tlong}分 --- 終了時刻設定 ${t_end#* } ${tlong}分
" iepg_e_ok=0 fi fi else iepg_e_ok=1 fi echo "
" fi fi if [ ${iepg_v:-1} = 0 ];then echo '
' else if [ ${yoyaku_ok:-0} = 1 ];then echo '
' fi fi iepg_br=1 if [ "$ma_user" = guest ];then echo " *** guestアカウントでは実行できません。***

" fi echo 0 >$htmaexe ok_ev=1 fi echo '
' fi if [ "$maexe" ]&&[ "$exe_v" = 0 ]&&[ "$err" != 1 ];then if [ "$err" = 1 ];then exe_err=2 elif [ "$kousin" ];then exe_err=0 else if [ "$ma_user" = guest ];then guest_maexe=1 exe_ev=1 else ee_v="ee=\`$ma_exe -t $start_t -e $tlong -c $ch -o $f_name $weekly_v $ma_auth $ma_exe_host -od $menat_h -vd $ma_h -vs $vs_hn $cr_iepg_opt $wcr_opt -i ${input_v:-c}\`" ee=`$ma_exe -t $start_t -e $tlong -c $ch -o $f_name $weekly_v $ma_auth $ma_exe_host -od $menat_h -vd $ma_h -vs $vs_hn $cr_iepg_opt $wcr_opt -i ${input_v:-c}`;exe_ev=$? #echo "$ee_v
" echo 1 >$htmaexe fi if [ -x "$ma_wk" ];then wx_e=`$ma_wk -vs $vs_hn -t` fi if [ "$exe_ev" != 0 ];then exe_err=1 if [ "$guest_maexe" = 1 ];then echo "guestアカウントでは予約登録できません。
" fi echo "$ee_v

" echo "$ee

err occured.
" else exe_err=0 if [ -x "$ee" ];then cr_cap_dev=`$ee -c cap_dev` if [ "`$ee -c cr_iepg`" != 0 ];then cr_iepg_dd0=`$ee -c iepg_dd|sed -n 's/#//;4,$p'` cr_iepg_dd1=`echo "$cr_iepg_dd0"|sed -n 's/^/
/;2,$p'` iepg_stn_str=`echo "$cr_iepg_dd0"|head -n1|cut -d' ' -f2` if [ "$st_uri" ];then iepg_stn="station: $iepg_stn_str" else iepg_stn="station: $iepg_stn_str" fi cr_iepg_dd="$iepg_stn $cr_iepg_dd1
" fi fi cr_cap_dev=${cr_cap_dev:-$cap_dev} fi fi if [ "$exe_err" != 0 ];then echo " 戻る" echo '

' date echo '
' exit 0 fi fi if [ ! "$m_v" ]||[ ${exe_ev:-1} = 0 ];then bv=" 設定 " else bv="再設定" fi if [ ! "$m_v" ];then org_ts=`date '+%Y %m/%d %H:%M'` if [ -f $menat_sys_d/capture.conf ];then . $menat_sys_d/capture.conf fi f_name=`date '+%Y%m%d%H%M'`.${ma_ext:-mjp} fi #echo "err=$err
" if [ ! "$err" = 1 ];then echo "
" echo "" #echo "maexe=$maexe kousin=$kousin
" if [ "$maexe" ];then # echo "exe_err=$exe_err
" if [ "$exe_err" = 0 ];then echo "下記の録画予約が登録されました。
" if [ "$cr_iepg_dd" ];then echo "
" echo "" echo "$cr_iepg_dd" echo "" fi echo "
" maexe=1 maexe_ok=1 fi elif [ "$kousin" ];then if [ "`cat $htmaexe2`" = $kousin ];then echo 0 >$htmaexe2 if [ "$kousin" ]&&[ "$vs_s" != 0 ]&&[ "`grep -c ^$kousin $ma_htrm`" = 0 ];then echo "ビデオサーバは現在使用不能です。

" echo $kousin >>$ma_htrm ln_keeper $ma_htrm else if [ "$kousin" ]&&[ `grep -c ^$kousin $ma_htrm` = 0 ];then ksn=1 echo $kousin >>$ma_htrm ln_keeper $ma_htrm else ksn=0 fi if [ $ma_run = 0 ]&&[ "$ksn" = 1 ];then echo "登録情報の更新を実行しています。
" if [ $vs_hn = localhost ]||[ $vs_hn_addr = $exe_hn_addr ];then m2_exv=`sudo /bin/su - menat -c "$menat_sad menat-web.cgi-$version"`;m2_exv_v=$? if [ $m2_exv_v = 0 ];then t_vv=1 else t_vv=0 fi else m2_exv=`wget -O - ${vs_href_cgi}menat-vs.cgi?mnt2=$$` t_vv=`echo $m2_exv|grep -c -e menat_mnt2_renewal_ok` fi echo "
" if [ "$t_vv" != 0 ];then echo "ビデオサーバ上の登録情報が更新されました。
" kousin_ok=1 else echo "ビデオサーバ上の登録に失敗しました。
" fi elif [ $ma_run = 1 ]&&[ "$ksn" = 1 ];then echo "
現在、ビデオサーバはキャプチャ中です。登録情報の更新はできません。
" fi fi fi fi echo "
" fi echo "
" echo "" hs_1="font-weight: bold; text-decoration: none; color: $ok_rgb;" tr_Y=${start_t:0:4} tr_m=${start_t:4:2};tr_m_n=${tr_m#0} tr_d=${start_t:6:2};tr_d_n=${tr_d#0} if [ ${#tr_d_n} = 1 ];then tr_d_n=" $tr_d_n" fi tr_H=${start_t:8:2} tr_M=${start_t:10:2} tt_start="$tr_H:$tr_M" if [ ! "$maexe" ]&&[ "$iepg_s_ok" = 0 ];then tt_start="$wrn_astr$tt_start" fi tp_start="${tr_Y}年 ${tr_m_n}月${tr_d_n}日 ?曜日 " if [ "$m_v" ];then if [ "$t_err" = 1 ]&&[ "$tp_err" != 1 ];then t_start="**** **月**日 **曜日 " tt_start="**:**" else t_start=`date -d $tr_Y$tr_m$tr_d '+%Y年 %-m月%_d日 %a曜日'` if [ "$rt_v" ]||[ "$p_cap_dev_n" ];then t_start="$rt_v$p_cap_dev_n $t_start" fi if [ "$tp_err" = 1 ]||[ "$Ymd_err" = 1 ]||[ ${pb_err} = 1 ];then if [ ! "$dv" ];then t_start="$tp_start" tt_start="$tt_start" else t_start="$t_start" tt_start="$tt_start" fi elif [ "$wrn" = 1 ];then wrn_style="style=\"font-weight: bold; color: $wrn_rgb; text-decoration: none;\"" if [ -x "$ee" ];then t_start="$t_start" else t_start="$t_start" fi tt_start="$tt_start" else if [ -x "$ee" ];then t_start="$t_start" else t_start="$t_start" fi if [ ${ot_wrn:-0} = 1 ];then tt_start="$tt_start" else tt_start="$tt_start" fi fi fi else t_start=`date '+%Y年 %-m月%_d日 %a曜日 '` if [ "$rt_v" ]||[ "$p_cap_dev_n" ];then t_start="$rt_v$p_cap_dev_n $t_start" fi fi if [ ! "$maexe" ];then if [ "$iepg_e_ok" = 0 ];then t_end="$wrn_astr$t_end" elif [ "$iepg_e_ok" = 2 ];then t_end="*$t_end" elif [ "$iepg_e_ok" = 3 ];then t_end="$ok2_astr$t_end" fi fi if [ "$tl_err" = 1 ];then t_end="**:**" ptlong="**分" elif [ "$tl_err2" = 1 ];then ptlong="$tlong分" if [ ${tom_over} = 1 ];then t_end="**:**" else t_end="$t_end" fi else ptlong="$tlong分" if [ "$t_err" = 1 ]&&[ ! "$tp_err" = 1 ];then t_end="**:**" elif [ "$tp_err" = 1 ]||[ "$Ymd_err" = 1 ]||[ ${pb_err} = 1 ];then t_end="$t_end" elif [ "$wrn" = 1 ]||[ ${ot_wrn:-0} = 1 ];then t_end="$t_end" else t_end="$t_end" fi fi if [ $input_v = v ]||[ $input_v = s ];then p1_ch=${ch}$input_v else p1_ch=$ch fi if [ "$ch_err" = 1 ];then pch="**" elif [ "$ch_wrn" = 1 ];then pch="$p1_ch" else if [ "$st_uri" ];then pch="$p1_ch" else pch="$p1_ch" fi fi fb_name=${f_name##*/} if [ "$f_err" = 1 ];then if [ "$of_err" = 1 ]&&[ "$fn_err" = 1 ];then fb_name="$fb_name" else if [ "$fn_err" = 1 ];then if [ ${f_opt:-none} != none ];then f_opt_style=":$f_opt" fi fb_name=" ${opf_name:-'********'}$f_opt_style" else if [ ${f_opt:-none} != none ];then f_opt_style=":$f_opt" fi fb_name=" ${opf_name:-'********'}:$f_opt_style" fi fi elif [ "$fl_wrn" = 1 ];then fb_name="$fb_name" elif [ ! "$f_name" ];then fb_name="********.***" else if [ -x "$ee" ];then ee_mop0=`$ee -c opt1` fb_name="$fb_name" else fb_name="$fb_name" fi fi if [ ! "$m_v" ];then tt_start=**:** t_end="**:**" ptlong="**分" pch=** fb_name=*****.${ma_ext:-mjp} echo '
' fi ex_iepg_err=`$ee -c iepg_err` if [ ${ex_iepg_err:-0} -gt 0 ];then ex8_iepg_err=$((${ex_iepg_err:-0}/8)) ex8r_iepg_err=$((${ex_iepg_err:-0}%8)) ex4_iepg_err=$((${ex8r_iepg_err:-0}/4)) ex4r_iepg_err=$((${ex8r_iepg_err:-0}%4)) ex2_iepg_err=$((${ex4r_iepg_err:-0}/2)) ex2r_iepg_err=$((${ex4r_iepg_err:-0}%2)) if [ $ex2r_iepg_err = 1 ];then tt_start="*$tt_start" fi if [ $ex2_iepg_err = 1 ];then t_end="*$t_end" fi if [ $ex4_iepg_err = 1 ];then t_start="? $t_start" fi if [ $ex8_iepg_err = 1 ];then if [ $ex2_iepg_err != 1 ];then t_end="*$t_end" fi fi else ex4_iepg_ext=`$ee -c iepg_ext` if [ ${ex4_iepg_ext:-0} -gt 0 ];then t_end="$ok2_astr$t_end" fi fi echo " " echo '
録画開始年月日
開始時刻
終了時刻
録画時間
ch
ファイルネーム
$t_start
$tt_start
$t_end
$ptlong
$pch
$fb_name

' if [ "$rm_v" = 0 ];then rm_Y=${rm_Ymd:0:4} rm_m=${rm_Ymd:4:2} rm_d=${rm_Ymd:6:2} org_ts="$rm_Y $rm_m/$rm_d $rm_H:$rm_M $rm_week" tlong_org=$epm pt_ch=$rm_pch f_name=$pf_name if [ ${rm_input_v:-0} = v ]||[ ${rm_input_v:-0} = s ];then if [ $ex_ch_ls = 1 ];then tlong=$tlong:$rm_input_v else pt_ch=$rm_pch$rm_input_v fi fi else pt_ch=`cat $ma_htchsl` pt_ch=${pt_ch:-1} if [ $input_v = v ]||[ $input_v = s ];then if [ $ex_ch_ls = 1 ];then tlong=$tlong:$input_v else if [ "$tl_iv_ok" = 1 ];then tlong=$tlong:$input_v fi if [ $input_ch = v ]||[ $input_ch = s ];then pt_ch=$ch$input_ch fi fi fi fi echo "
'>>$cal_dd echo $mkp_Ymd >$t_web fi if [ "$act" = 1 ]||[ "$maexe" = 1 ];then min_cal_8=$c_y${m1}01 #echo "\`date -d \"2month -1day $min_cal_8\" '+%Y%m%d'\`
" #echo "date=`date -d \"2month -1day $min_cal_8\" '+%Y%m%d'`
" max_cal_8=`date -d "2month -1day $min_cal_8" '+%Y%m%d'` if [ "$min_cal_8" '<' "$st_st_Ymd" ]&&[ "$st_st_Ymd" '<' "$max_cal_8" ];then cal_maexe_ok=1 else cal_maexe_ok=0 fi if [ "$t_err" != 1 ]&&[ "$Ymd_err" != 1 ]&&[ "$cal_maexe_ok" = 1 ];then st_p_d=${st_st_d#0} act_d="$st_p_d<\/span><\/blink>" cal_m=${cal_dd#*/cal.};cal_m=${cal_m%%.*};cal_m=${cal_m:4:2};cal_m=${cal_m#0} if [ $cal_m = ${st_st_m#0} ];then cal_dd2=`sed -n "/${cal_m}月/,/$st_p_d$act_d  



" if [ $ex_ch_ls = 1 ];then echo "チャンネル :
" else echo "
" fi echo "
" echo "
" if [ "$iepg" ];then iepg_vs=iEPG fi if [ "$m_v" ]&&[ "$err" != 1 ]&&[ ${exe_ev:-1} != 0 ];then echo "" echo 0 >$htmaexe else echo 1 >$htmaexe fi echo '
' cal_dd=${htdir}cal.$w_nt_Ymd.$vs_hn.db holyday_dd=${htdir}holyday.db mkcal_YmdHM=`ft_date $cal_dd` mkprog_HM=`date -d "00:00 ${delay_H}hour" '+%H%M'` if [ -x $menat_mkprog ]&&[ $ex_ch_ls = 1 ];then mkprog_ok=1 else mkprog_ok=0 fi if [ "$mk_cal_ok" != 1 ];then if [ "$mkprog_ok" = 1 ];then if [ ${cal_reload:-0} != 0 ];then if [ "`grep -c ^$cal_reload $ma_htrm`" = 0 ];then echo $cal_reload >>$ma_htrm ln_keeper $ma_htrm rm -f ${htdir}cal.*.db mk_cal_ok=1 else mk_cal_ok=0 fi elif [ $w_nt '>' ${w_nt_Ymd}${mkprog_HM} ]&&[ $mkcal_YmdHM '<' ${w_nt_Ymd}${mkprog_HM} ];then rm -f ${htdir}cal.*.db mk_cal_ok=1 else mk_cal_ok=0 fi else mk_cal_ok=0 fi fi if [ ! -f $cal_dd ]||[ "$mk_cal_ok" = 1 ];then if [ "$mkprog_ok" = 1 ];then p_date_1=$mkp_Ymd p_date_2=`date -d "1day $mkp_Ymd" '+%Y%m%d'` p_date_3=`date -d "2day $mkp_Ymd" '+%Y%m%d'` p_date_4=`date -d "3day $mkp_Ymd" '+%Y%m%d'` p_date_5=`date -d "4day $mkp_Ymd" '+%Y%m%d'` p_date_6=`date -d "5day $mkp_Ymd" '+%Y%m%d'` p_date_7=`date -d "6day $mkp_Ymd" '+%Y%m%d'` p_date_8=`date -d "7day $mkp_Ymd" '+%Y%m%d'` mkprog_ok=1 fi if [ -f $holyday_dd ];then holyday_dd_YmdHM=`ft_date $holyday_dd` exp_holyday_dd_YmdHM=`date -d -1month '+%Y%m%d%H%M'` if [ $exp_holyday_dd_YmdHM '>' $holyday_dd_YmdHM ];then rm -fr $holyday_dd fi fi if [ ! -f $holyday_dd ];then p_nt_Ymd=`date -d -2month '+%Y-%m-%d'` p_1y_Ymd=`date -d 10month '+%Y-%m-%d'` wget -O $holyday_dd.xml "http://www.google.com/calendar/feeds/japanese@holiday.calendar.google.com/public/full?start-min=$p_nt_Ymd&start-max=$p_1y_Ymd" 2>/dev/null for t in `nkf -Lue $holyday_dd.xml|sed 's//tle>\n\n/g;s/};holyday_name=${holyday_name%\<*} elif [ ${t%%=*} = startTime ];then eval $t echo ${startTime}:$holyday_name fi done |sort -k2 >$holyday_dd fi w_nt_Ym=${w_nt:0:6} w_nt_m=${w_nt:4:2} rm -f ${htdir}cal.*.$vs_hn.db n_d=`date '+%d'`;rn_d=${n_d#0} cal_td_style="style=\"text-align: center;\"" href_cal_reload="" echo "
  
"> $cal_dd for d in `cal|sed 1,2d` ;do c_ym=${w_nt:0:6} if [ ${#d} = 1 ];then pd=0$d else pd=$d fi nd=$d tt_Ymd=$c_ym$pd wk=`date -d $c_ym$pd '+%w'` wq=$wk if [ $d = 1 ];then while [ $wq != 0 ];do echo "">>$cal_dd wq=$(($wq-1)) done fi if [ $d = $rn_d ];then cal_td_style="style=\"text-align: center;background-color: $cf3_rgb;\"" else cal_td_style="style=\"text-align: center;\"" fi holyday_d_dd=`grep $tt_Ymd $holyday_dd` if [ "$holyday_d_dd" ];then d="$d" holyday_title="title=\"${holyday_d_dd#*:}\"" else holyday_title="" if [ $wk = 0 ];then d="$d" elif [ $wk = 6 ];then d="$d" else d="$d" fi fi d="$d" if { [ $tt_Ymd = $p_date_8 ]||[ $tt_Ymd '<' $p_date_8 ]; }&&{ [ $tt_Ymd = $p_date_1 ]||[ $tt_Ymd '>' $p_date_1 ]; }&&[ "$mkprog_ok" = 1 ];then if [ $tt_Ymd = $p_date_1 ];then d="$d" elif [ $tt_Ymd = $p_date_2 ];then d="$d" elif [ $tt_Ymd = $p_date_3 ];then d="$d" elif [ $tt_Ymd = $p_date_4 ];then d="$d" elif [ $tt_Ymd = $p_date_5 ];then d="$d" elif [ $tt_Ymd = $p_date_6 ];then d="$d" elif [ $tt_Ymd = $p_date_7 ];then d="$d" else d="$d" fi fi if [ $wk = 0 ];then echo "">>$cal_dd elif [ $wk = 6 ];then echo "">>$cal_dd else echo "">>$cal_dd fi done echo "
`date '+%Y年%_m月'`
$d$d
$d
">>$cal_dd nn_Ym=`date '+%Y%m'`;nn_m0="${nn_Ym}01";nn_m=`date -d "40day $nn_m0" '+%Y%m%d'` m1=${nn_m:4:2};c_y=${nn_m:0:4} nn_Ym_1=$c_y$m1 echo "">>$cal_dd for d in `cal $m1 $c_y|sed '1,2d'` ;do c_ym=${nn_m:0:6} if [ ${#d} = 1 ];then pd=0$d else pd=$d fi nd=$d wk=`date -d $c_ym$pd '+%w'` wq=$wk if [ $d = 1 ];then while [ $wq != 0 ];do echo "">>$cal_dd wq=$(($wq-1)) done fi holyday_d_dd=`grep $c_ym$pd $holyday_dd` if [ "$holyday_d_dd" ];then d="$d" holyday_title="title=\"${holyday_d_dd#*:}\"" else holyday_title="" if [ $wk = 0 ];then d="$d" elif [ $wk = 6 ];then d="$d" else d="$d" fi fi if [ $nn_Ym_1$pd -le $p_date_8 ]&&[ $nn_Ym_1$pd -ge $p_date_1 ]&&[ "$mkprog_ok" = 1 ];then if [ $nn_Ym_1$pd = $p_date_1 ];then d="$d" elif [ $nn_Ym_1$pd = $p_date_2 ];then d="$d" elif [ $nn_Ym_1$pd = $p_date_3 ];then d="$d" elif [ $nn_Ym_1$pd = $p_date_4 ];then d="$d" elif [ $nn_Ym_1$pd = $p_date_5 ];then d="$d" elif [ $nn_Ym_1$pd = $p_date_6 ];then d="$d" elif [ $nn_Ym_1$pd = $p_date_7 ];then d="$d" else d="$d" fi fi if [ $nn_Ym_1$pd = "$st_st_Ymd" ];then act_d="$nd<\/span>" act_d_exe="|sed \"s/>$nd$act_d">>$cal_dd elif [ $wk = 6 ];then echo "">>$cal_dd else echo "">>$cal_dd fi done echo '
${c_y}年 ${m1#0}月
$d$d
$d
$cal_dd2" sed -n '//p" $cal_dd|sed "s/>$st_p_d$act_d
$cal_dd2" fi else cat $cal_dd fi else cat $cal_dd fi echo "
 
" ttle="録画予約一覧" wd_t=90 wd_s=31 wd_l=12 wd_f=28 else menat_h_org=$menat_h menat_h=$menat_h/$past2 rm1_Ymd=${ma_rm:0:8} rm1_H=${ma_rm:8:2} rm1_M=${ma_rm:10:2} if [ "$rm_gl" = 1 ];then ap_pd=`pwd`;cd $menat_h_t ht_str=`sed 's/&/ /g'` for np in $ht_str ;do fn0=${np#*=};fn1=${fn0%-*};fn1=${fn1%%.*};dvn=`n_ident $fn1`;dvn_v=$? if [ ${#fn1} != 12 ]||[ $dvn_v != 0 ]||[ ! -f $menat_h_t/$fn0 ];then continue fi rm_str="$rm_str $fn0" done if [ "$rm_str" ];then for t_t in $rm_str ;do ma_rm_owner=`$menat_h_t/$t_t -c menat_user` if [ "$ma_rm_owner" = "$ma_user" ]||[ "$admin_v" = 0 ];then rm -f $menat_h_t/$t_t;svv=$? if [ $svv = 0 ];then rm_s_l="${t_t##*/} $rm_s_l" else rm_f_l="${t_t##*/} $rm_f_l" fi else rm_p_l="${t_t##*/} $rm_p_l" fi done if [ "$rm_s_l" ];then rm -f $menat_h_t/db*pprog* fi else svv="d" fi cd $ap_pd if [ "$rm_s_l" ];then echo "
以下の抹消済み録画予約設定ファイルが削除されました。
$rm_s_l

" fi if [ "$rm_f_l" ];then echo "
以下の抹消済み録画予約設定ファイルの削除に失敗しました。
$rm_f_l

" fi if [ "$rm_p_l" ];then echo "
以下の抹消済み録画予約設定ファイルに対するパーミッションがありません。
$rm_p_l

" fi else if [ "$ma_rm" ];then ma_rm_org=$ma_rm if [ -f $menat_h/$ma_rm.w.mtq ];then ma_rm=$ma_rm.w.mtq elif [ -f $menat_h/$ma_rm.W.mtq ];then ma_rm=$ma_rm.W.mtq elif [ -f $menat_h/$ma_rm.n.mtq ];then ma_rm=$ma_rm.n.mtq fi pch=`$menat_h/$ma_rm -c pch` if [ "$pch" = v ];then pch="Composite1" elif [ "$pch" = s ];then pch="S-Video" fi epm=`$menat_h/$ma_rm -c time_epm` pf_name=`$menat_h/$ma_rm -c name_f` pf_name=${pf_name##*/} popt=`$menat_h/$ma_rm -c opt1` if [ "$popt" ];then pf_name=$pf_name:$popt fi prj="`date -d $rm1_Ymd '+%Y年 %-m月%_d日 %a曜日'` $rm1_H:$rm1_M $epm分 $pch $pf_name" if [ `grep -c ^0$prmt $ma_htrm` = 0 ];then echo 0$prmt >>$ma_htrm ln_keeper $ma_htrm echo "
" if [ -f $menat_h/$ma_rm ];then ma_rm_owner=`$menat_h/$ma_rm -c menat_user` if [ "$ma_rm_owner" = "$ma_user" ]||[ "$admin_v" = 0 ];then rm -f $menat_h/$ma_rm;rm_v=$? rm -f $menat_h_t/db*pprog* else per_v=1 fi if [ "$per_v" = 1 ];then echo "$prj *** この抹消済み録画予約設定ファイルに対するパーミッションがありません。" elif [ "$rm_v" = 0 ];then echo "$prj *** この抹消済み録画予約設定ファイルを削除しました。
" else echo " $prj *** この抹消済み録画予約設定ファイルを削除することができませんでした。
" fi else echo "
$prj *** この抹消済み録画予約設定ファイルはすでに削除されています。
" fi echo "
" fi else echo "$w_nt" >/dev/null fi fi m_v=${m_v#past=1&} ttle="終了、抹消済録画予約一覧" wd_t=95 wd_s=30 wd_l=11 wd_r=5 wd_f=27 fi ################################################################################## ###################### program table ########################## ################################################################################## echo '
' echo -n $ttle echo "  予約概況" echo "
" dnn=1 bgc=1 if [ "$past2" ];then ma_tab=`ls -r $menat_h_t/*.mtq` mtq_nn=`ls $menat_h_t/*.mtq|wc -l` if [ ! -f $menat_h_t/db.$ma_user.pprog ]||[ $menat_h_t -nt $menat_h_t/db.$ma_user.pprog ];then re_vv=$menat_h_t/db.$ma_user.pprog echo >$menat_h_t/db.$ma_user.pprog re_db=1 elif [ "$reload" ]&&[ "`grep -c ^$reload $ma_htrm`" = 0 ];then re_vv=$menat_h_t/db.$ma_user.pprog echo >$menat_h_t/db.$ma_user.pprog re_db=1 echo $reload >>$ma_htrm ln_keeper $ma_htrm elif [ $mtq_nn != "`grep -c '' $menat_h_t/db.$ma_user.pprog`" ];then i=0 for t in `ls $menat_h_t/*.mtq` ;do t2=${t##*/} t3=${t2%.*.mtq} if [ ${#t3} = 12 ];then i=$(($i+1)) else if [ "$err_ma_ls" ];then err_ma_ls="$err_ma_ls
$t" else err_ma_ls="$t" fi fi done if [ $i != `grep -c '' $menat_h_t/db.$ma_user.pprog` ];then re_vv=$menat_h_t/db.$ma_user.pprog echo >$menat_h_t/db.$ma_user.pprog re_db=1 err_ma_ls="" else re_vv=/dev/null re_db=0 fi else re_vv=/dev/null re_db=0 fi echo "" cat_db=$menat_h_t/db.$ma_user.pprog if [ ! -f $ma_htprogptok ];then re_db=1 fi else ma_tab=`ls $menat_h/*.mtq` mtq_nn=`ls $menat_h/*.mtq|wc -l` if [ ! -f $ma_htprogtok ];then rm -f $menat_h_t/db.prog fi if [ "$maexe_ok" = 1 ];then re_db=1 re_vv=/dev/null elif [ "$bx_l" ]||[ "$re_err_l" ];then re_db=1 re_vv=/dev/null elif [ "$kousin_ok" = 1 ];then re_db=1 re_vv=$menat_h_t/db.prog echo >$menat_h_t/db.prog elif [ ! -f $menat_h_t/db.prog ]||[ $menat_h_t/db.prog -ot $menat_h ];then re_db=1 re_vv=$menat_h_t/db.prog echo >$menat_h_t/db.prog elif [ "$reload" ]&&[ "`grep -c ^$reload $ma_htrm`" = 0 ];then re_db=1 re_vv=$menat_h_t/db.prog echo >$menat_h_t/db.prog echo $reload >>$ma_htrm ln_keeper $ma_htrm elif [ $mtq_nn != "`grep -c '' $menat_h_t/db.prog`" ];then i=0 for t in `ls $menat_h/*.mtq` ;do t2=${t##*/} t3=${t2%.*.mtq} if [ ${#t3} = 12 ];then i=$(($i+1)) else if [ "$err_ma_ls" ];then err_ma_ls="$err_ma_ls
$t" else err_ma_ls="$t" fi fi done if [ $i != `grep -c '' $menat_h_t/db.prog` ];then re_vv=$menat_h_t/db.prog echo >$menat_h_t/db.prog re_db=1 err_ma_ls="" else re_vv=/dev/null re_db=0 fi else re_vv=/dev/null re_db=0 fi cat_db=$menat_h_t/db.prog fi echo " " for t in $ma_tab ;do if [ $re_db = 0 ];then if [ "$past2" ];then cat $cat_db else if [ "`ls $menat_h/*.n*.mtq 2>/dev/null`" ];then renew_vs_que=1 fi cat $cat_db fi cat_t=1 break fi rm -f $htdir.htprog*ok cat_t=2 tt=${t##*/} tt_org=$tt tt=${tt%.*.mtq} dvn=`n_ident $tt`;dvn_v=$? if [ -d $t ]||[ ${#tt} != 12 ]||[ $dvn_v != 0 ];then if [ "$err_ma_ls" ];then err_ma_ls="$err_ma_ls
$t" else err_ma_ls="$t" fi continue fi sfE_v=${tt_org#*.} sfE_v=${sfE_v%%.*} p_sfE_v="" t_tYmd=${tt%????} t_tY=${tt:0:4} t_tm=${tt:4:2} t_td=${tt:6:2} t_tH=${tt:8:2} t_tM=${tt:10:2} if [ "$d_cv" != "$t_tYmd" ];then dnn=$(($dnn+1)) d_cv=$t_tYmd fi mod_str=`ls -lL $t|tr -s ' ' ' '|cut -d' ' -f1-4` if [ ! -r $t ];then r_err=1 elif [ ${mod_str:7:1} = r ];then r_err=0 elif [ `groups menat|grep -c $(echo $mod_str|cut -d' ' -f4)` != 0 ];then if [ ${mod_str:4:1} = r ];then r_err=0 else if [ `echo $mod_str|cut -d' ' -f3` = menat ];then if [ ${mod_str:1:1} = r ];then r_err=0 else r_err=1 fi else r_err=1 fi fi elif [ `echo $mod_str|cut -d' ' -f3` = menat ];then if [ ${mod_str:2:1} = r ];then r_err=0 else r_err=1 fi else r_err=1 fi t_start=`date -d $t_tYmd '+%Y年 %-m月%_d日 %a曜日'` ap_vv=`grep -c 'menat menat_que_record$' $t` maf_v=`grep ^version= $t|head -1 |cut -d'=' -f2` if [ ${maf_v:-0} = "${maf_v%cmp}" ]&&[ $maf_v '>' 1.1.5 ];then cr_exe_c=1 iepg_ext="" iepg_title="" week="" . $t -c >/dev/null export LANG=ja_JP.eucJP ch=$ch rt_vv1=${week:-0} cap_dev_v=$cap_dev fl_name=$name_f bfn=$bfn cr_iepg_ttl=$iepg_title t_cr_iepg=$cr_iepg ex_iepg_err=$iepg_err ext_iepg_v=$iepg_ext mat_e=$time_e t_input_v=$input_v mop0=$opt1 cmp_v=$cmp_v org_id=$org_id t_epm=$time_epm t_cap_dev=$cap_dev_v fex_prs_id=$prs_id f_owner=$menat_user if [ "$iepg_title" ];then ref_title="title=\"$iepg_title\"" else ref_title="" fi if [ ${exe_v:-0} != -1 ];then renew_vs_que=1 fi else cr_exe_c=0 ch=`grep ^ch= $t|head -n 1|cut -d'=' -f2` rt_vv1=`grep ^week= $t|head -n 1|cut -d'=' -f2` cap_dev_v=`grep ^cap_dev= $t|head -n 1|cut -d'=' -f2` fl_name=`grep ^name_f= $t|head -n 1|cut -d'=' -f2` bfn=${fl_name##*/} cr_iepg_ttl=`grep '^#program-title:' $t|head -n1` t_cr_iepg="" ext_iepg_v=`sed -n "${fl_n},${iepg_end_ln}p" $t|grep "^#Extend: "|cut -d' ' -f2` mat_e=`grep ^time_e= $t|head -n 1|cut -d'=' -f2|cut -d' ' -f1` t_input_v=`grep ^input_v= $t|head -n 1|cut -d'=' -f2` mop0=`grep ^opt1= $t|head -n 1|cut -d'=' -f2`;mop0=${mop0#\"};mop0=${mop0%\"} cmp_v=`grep ^cmp_v= $t|head -n 1|cut -d'=' -f2` org_id=`grep ^org_id= $t|head -n 1|cut -d';' -f1|cut -d'=' -f2` t_epm=`grep ^time_epm= $t|head -n 1|cut -d'=' -f2` t_cap_dev=$cap_dev_v fex_prs_id=`grep ^org_id= $t|head -n 1|cut -d';' -f2|cut -d'=' -f2` f_owner=`grep ^menat_user= $t|head -n 1|cut -d'=' -f2` fi blink_start="" blink_end="" prs_e2="" prs_id=${prs_id:-$bfn} if [ ${prs_id:-0} != 0 ]&&[ -f $menat_h_t/$prs_id.e2.iepg ]&&[ "$past" != 1 ];then blink_start="" blink_end="" e2_iepg_ls="$e2_iepg_ls $menat_h_t/$prs_id.e2.iepg" prs_e2="&prs_e2=$prs_id" fi if [ ${cr_iepg:-0} -gt 0 ];then cr_iepg_ok=1 fi if [ ${ex_iepg_err:-0} -gt 0 ];then ex8_iepg_err=$((${ex_iepg_err:-0}/8)) ex8r_iepg_err=$((${ex_iepg_err:-0}%8)) ex4_iepg_err=$((${ex8r_iepg_err:-0}/4)) ex4r_iepg_err=$((${ex8r_iepg_err:-0}%4)) ex2_iepg_err=$((${ex4r_iepg_err:-0}/2)) ex2r_iepg_err=$((${ex4r_iepg_err:-0}%2)) if [ $ex2r_iepg_err = 1 ];then iepg_st_err=1 else iepg_st_err=0 fi if [ $ex2_iepg_err = 1 ];then iepg_end_err=1 else iepg_end_err=0 fi if [ $ex4_iepg_err = 1 ];then iepg_ttl_err=1 else iepg_ttl_err=0 fi if [ $ex8_iepg_err = 1 ];then iepg_ext_err=1 else iepg_ext_err=0 fi iepg_tmp_err=0 else iepg_st_err=0 iepg_end_err=0 iepg_ttl_err=0 iepg_ext_err=0 if [ ${iepg_err:-0} != 0 ];then iepg_tmp_err=1 else iepg_tmp_err=0 fi fi if [ $r_err != 0 ];then fcc=" color: $fr_rgb;" elif [ $(($dnn%2)) = 0 ];then fcc=" color: $tf1_rgb;" fcc2=" color: $wrn_rgb;" fcc3=" color: $tf2_rgb;" else fcc=" color: $tf2_rgb;" fcc2=" color: $wrn_rgb;" fcc3=" color: $tf1_rgb;" fi if [ "$rt_vv1" = 0 ];then rt_vv1="" fi cap_dev_v=${cap_dev_v:-/dev/video0} cap_dev_n=${cap_dev_v#/dev/video} case "$cap_dev_n" in [1-3] ) p_cap_dev_n=$cap_dev_n ;; * ) p_cap_dev_n="" ;; esac fl_name=${fl_name:-unknown} fb_name=${fl_name##*/} fb_name_org=$fb_name tt_start="$t_tH:$t_tM" if [ $cap_dev_n -gt 0 ];then rt_vv2=$cap_dev_n else rt_vv2="" fi rt_vv=$rt_vv1$rt_vv2 t_start="$rt_vv $t_start" if [ ${iepg_ttl_err:-0} = 0 ];then p_ast="*" else p_ast="*?" fi if [ "$ap_vv" != 0 ];then if [ "$past" != 1 ];then if [ -d $menat_lock ];then if [ -f $menat_lock/$fb_name ];then t_start="$p_ast $t_start" if [ `grep -c ^ex_sleep= $menat_lock/$fb_name` != 0 ];then cap_err=1 else cap_err=0 fi else t_start="$p_ast $t_start" if [ $w_nt '>' $tt ];then cap_err=1 else cap_err=0 fi fi elif [ -f $menat_lock ];then if [ $bgc = 1 ];then t_start="$p_ast $t_start" cap_err=0 else if [ $w_nt '>' $tt ];then cap_err=1 else cap_err=0 fi t_start="$p_ast $t_start" fi else t_start="$p_ast $t_start" if [ $w_nt '>' $tt ];then cap_err=1 else cap_err=0 fi fi elif [ -r $t ];then t_start="$p_ast $t_start" cap_err=0 fi else if [ ${iepg_ttl_err:-0} = 1 ];then t_start="? $t_start" fi cap_err=0 fi if [ ${iepg_st_err:-0} = 1 ];then tt_start="$wrn_astr$tt_start" fi pst_HM="$t_tH$t_tM" dvn=`n_ident $mat_e`;dvn_v=$? if [ ! "$mat_e" ]||[ ${#mat_e} != 12 ]||[ $dvn_v != 0 ];then mat_e=$tt fi te_Ymd=${mat_e:0:8} te_H=${mat_e:8:2} te_M=${mat_e:10:2} te_HM=$te_H$te_M if [ 1$te_HM '<' 1$pst_HM ];then t_end="翌 $te_H:$te_M" else t_end="$te_H:$te_M" fi fl_n=`grep -n '#!/bin/sh' $t|head -n1|cut -d':' -f1` for r in `grep -n '^$' $t|cut -d':' -f1` ;do if [ $r -gt $fl_n ];then iepg_end_ln=$(($r-1)) break fi done if [ ${iepg_ext_v:-0} != 0 ];then if [ ${iepg_end_err:-0} = 1 ];then t_end="$wrn_astr$t_end" else if [ ${iepg_ext_err:-0} = 1 ];then t_end="$wrn2_astr$t_end" else t_end="$ok2_astr$t_end" fi fi else if [ ${iepg_end_err:-0} = 1 ];then t_end="$wrn_astr$t_end" fi fi if [ ${iepg_tmp_err:-0} = 1 ];then tt_start="$tt_start" t_end="$t_end" fi eval max_ed_YmdHM='$'max_ed_YmdHM_$cap_dev_n if [ "$past" != 1 ]&&[ "$max_ed_YmdHM" ];then if [ "$max_ed_YmdHM" '<' $tt ]||[ "$max_ed_YmdHM" = $tt ];then sf_v=0 else sf_v=1 fi else sf_v=0 fi if [ ${max_ed_YmdHM:-0} '<' $mat_e ];then eval max_ed_YmdHM_$cap_dev_n=$mat_e fi if [ "$ch" = Composite1 ];then ch=v cr_iepg_ok=1 href_ch=$ch elif [ "$ch" = S-Video ];then ch=s cr_iepg_ok=1 href_ch=$ch else ch=${ch:-\?} if [ ${t_input_v:-c} != c ];then ch=$ch$t_input_v fi if [ $ex_ch_ls = 1 ];then iepg_web_str=`grep ch$ch $menat_iepg/ch.list|cut -d':' -f6` st_uri="http://$iepg_web_str/" if [ "$st_uri" ];then iepg_st_name=`grep ch$ch $menat_iepg/ch.list|cut -d':' -f2` href_style="style=\"text-decoration: none; $fcc;\"" href_ch="$ch" else href_ch=$ch fi else href_ch=$ch fi fi if [ "$fb_name" = "$org_f_name" ]&&[ "$tt" != "$start_t" ];then fbcc=" background-color: $twrn2_rgb;" elif [ "$fb_name" = "$db_er_fn" ];then fbcc=" background-color: $twrn2_rgb;" else fbcc="" fi if [ "$mop0" ]&&[ "$mop0" != none ];then fb_name="$fb_name:$mop0" fi pfb_name=$fb_name if [ "$past" = 1 ];then cmp_lock=$menat_h_t/lock.${fb_name_org%.$ma_ext} if [ `grep -c ' menat_ends$' $t` != 0 ];then cmp_fv=`tail -n1 $t|grep -c '^#compress ended '` sfE_v1=${sfE_v:0:1} if [ "$sfE_v1" = f ]||[ "$sfE_v1" = t ]||[ "$sfE_v1" = E ]||[ -f $cmp_lock ];then p_sfE_v="$sfE_v1" elif [ "$sfE_v1" = c ];then p_sfE_v="$sfE_v1" cr_iepg_ok=1 else if [ $cmp_v = 0 ];then p_sfE_v="s" elif [ $cmp_fv != 0 ];then p_sfE_v="*" elif [ "$sfE_v" ];then p_sfE_v="$sfE_v" else p_sfE_v="x" fi fi cap_ok=1 non_cap=0 else cap_ok=0 dvn=`n_ident $sfE_v`;dvn_v=$? if [ $dvn_v = 0 ];then non_cap=1 p_sfE_v="" else p_sfE_v="$sfE_v" non_cap=0 fi fi if [ "$p_sfE_v" ];then if [ ${org_id:-0} != 0 ]&&[ `echo "$org_id_db" |grep -c ^$org_id\$` = 0 ];then p_sfE_v="$p_sfE_v" if [ "$org_id_db" ];then org_id_db="$org_id_db $org_id" else org_id_db=$org_id fi fb_name="$p_sfE_v $fb_name" else fb_name="$p_sfE_v $fb_name" fi fi fi if [ ! "$t_epm" ];then t_epm_st=`date -d "$t_tYmd $t_tH:$t_tM" '+%s'` t_epm_ed=`date -d "$te_Ymd $te_H:$te_M" '+%s'` t_epm=$(($(($t_epm_ed-$t_epm_st))/60)) t_epm_r=$(($(($t_epm_ed-$t_epm_st))%60)) if [ $t_epm_r -ge 30 ];then t_epm=$(($t_epm+1)) fi fi hhh=`echo "$bx_l" hhh|grep -c $tt` if { [ "$start_t" = $tt ]||[ $hhh != 0 ]; }&&[ ! "$past" ];then if [ "$maexe" ]&&[ "$exe_err" = 0 ]&&[ "$sf_v" != 1 ];then t_cap_dev=$cap_dev_v if [ ${t_cap_dev:-/dev/video0} = ${cr_cap_dev:-/dev/video0} ];then if [ ${hhh:-0} = 0 ];then bcc=" background-color: $info2_rgb;" else bcc=" background-color: $info_rgb;" fi else bcc=" background-color: $info_rgb;" fi else bcc=" background-color: $info_rgb;" fi elif [ $cap_err = 1 ];then bcc=" background-color: $cap3_rgb;" elif [ "$sf_v" = 1 ];then bcc=" background-color: $info_rgb;" elif [ $(($bgc%10)) = 0 ];then bcc=" background-color: $tbg2_rgb;" elif [ $(($bgc%2)) = 0 ];then bcc=" background-color: $tbg1_rgb;" else bcc="" fi if [ ! "$fbcc" ];then fbcc=$bcc fi fc=$fcc$bcc if [ $ex_ch_ls = 1 ];then if [ $cr_iepg_ok = 1 ];then fc_i=$fc else fc_i=$fcc2$bcc fi else fc_i=$fc fi ffc=$fcc$fbcc bgc=$(($bgc+1)) if [ "$past" = 1 ];then pm_v="&past=1&past2=tmp" fi t_start="$blink_start$t_start$blink_end" fb_name="$fb_name" echo " " |tee -a $re_vv i2=${i2:-0} if [ "$past" = 1 ];then i2=$(($i2+1)) if [ -f $menat_h_t/ma_id.db ];then file_ls=$menat_h_t/ma_id.db db_file_n=1 elif [ "$vs_res" = 0 ];then file_ls='$ma_htmdss' else if [ -f $menat_h_t/vs.html ]&&[ -f $ma_htmdss ];then if [ ${exe_hn%%.*} = $vs_hn ];then if [ $menat_h_t/vs.html -nt $ma_htmdss ];then file_ls=$menat_h_t/vs.html else file_ls=$ma_htmdss fi else file_ls=$menat_h_t/vs.html fi elif [ -f $menat_h_t/vs.html ];then file_ls=$menat_h_t/vs.html elif [ -f $ma_htmdss ];then file_ls=$ma_htmdss else file_ls=/dev/null fi fi if [ $cap_ok = 1 ];then if [ "$db_file_n" = 1 ];then if [ "$fex_prs_id" ]&&[ `grep -c ";$fex_prs_id;" $file_ls` != 0 ];then exist_f_ok=1 else exist_f_ok=0 fi fi if [ "$db_file_n" != 1 ]||[ ! "$fex_prs_id" ];then mtq_cap_v=${tt:13:1} if [ `grep -c $fb_name_org $file_ls` != 0 ];then exist_org_ok=1 elif [ "$mtq_cap_v" = s ]||[ "$mtq_cap_v" = f ];then exist_org_ok=0 else exist_org_ok=0 fi fb_name_org_v=$cmp_v if [ "$fb_name_org_v" != 1 ];then exist_cmp_ok=0 else fb_name_org2=`grep ^\#${fb_name_org%$ma_ext} $t|tail -n1` fb_name_org2=${fb_name_org2#\#};fb_name_org2=${fb_name_org2%%:*} exist_cmp_ok=`grep -c $fb_name_org2 $file_ls` fi if [ ${exist_org_ok:-0} = 0 ]&&[ ${exist_cmp_ok:-0} = 0 ];then exist_f_ok=0 else exist_f_ok=1 fi fi else exist_f_ok=0 fi if [ "$exist_f_ok" = 1 ];then fc_fp=" background-color: $info2_rgb;" else fc_fp=$fc fi f_owner=${f_owner:-menat} if [ -f $cmp_lock ]&&[ "$non_cap" != 1 ];then if [ `grep -c menat_cmp_id $cmp_lock` != 0 ];then echo "" |tee -a $re_vv else echo "" |tee -a $re_vv fi elif [ "$ma_user" = $f_owner ]||[ "$admin_v" = 0 ];then echo "" |tee -a $re_vv else echo "" |tee -a $re_vv fi fi echo " " |tee -a $re_vv tab_n=$(($tab_n+1)) done if [ ! "$t_tYmd" ]&&[ "$bgc" = 1 ];then if [ ! "$past" ];then if [ "$cat_t" != 1 ]||[ ! "`cat $menat_h_t/db.prog`" ];then echo " " fi else if [ "$cat_t" != 1 ]||[ ! "`cat $menat_h_t/db.$ma_user.pprog`" ];then echo " " fi fi fi if [ "$past2" ];then echo >$ma_htprogptok else echo >$ma_htprogtok fi if [ "$past" = 1 ];then echo "" nn_str="終了、抹消済み録画予約総数" else nn_str="録画予約総数" fi echo '
録画開始年月日
開始時刻
終了時刻
録画時間
ch
ファイルネーム
$t_start
$tt_start
$t_end
${t_epm}分
$href_ch
$fb_name
+ - -
 
 
 
 
 
 
 
 
 
 
 
 
-
' if [ ${past:-0} != 1 ]&&[ ${cat_t:-1} != 1 ];then for st1 in $e2_iepg_ls ;do cp $st1 $st1.back st1_ls="$st1_ls $st1" rm -f $menat_h_t/db*pprog* done rm -f $menat_h_t/*.e2.iepg for st2 in $st1_ls ;do mv -f $st2.back $st2 done fi if [ "$vs_s" = 0 ];then if [ "$ma_user" != guest ]&&[ "$past" != 1 ];then if [ ${renew_vs_que:-0} = 1 ]&&[ $sad_ok = 1 ]&&[ $ma_run = 0 ];then kousin_button=" 
" echo k${ma_id} >$htmaexe2 else kousin_button="     " fi else kousin_button="     " fi else if [ -x $menat_bin/menat-wol.sh ]&&[ "$ma_user" != guest ]&&[ "$past" != 1 ];then kousin_button=" 
" else kousin_button="     " fi fi k_line_h="line-height: 200%;" echo "
user -- $ma_user, host -- $ma_host, $nn_str ${tab_n:-$mtq_nn}
$kousin_button
" if [ "${err_ma_ls:-$menat_h/*.mtq}" != "$menat_h/*.mtq" ];then echo "以下の予期せぬファイルが存在します。
$err_ma_ls" fi echo -n "
" for t in $vs_ls ;do if [ "$past" ];then break fi if [ $t = localhost ]&&[ $exe_hn_on = 0 ];then continue elif [ $vs_name = $t ];then continue fi tt=${t%%.*} echo -n "video server $tt " done echo "

 index.html" if [ ! "$past" ];then echo " reload" echo " 過去の録画予約" else echo " 録画予約画面に戻る" echo " reload" fi if [ -x /var/menat/public_html/menat-conf.cgi ];then if [ $vs_hn = localhost ]||[ $ma_host = $vs_hn_addr ];then echo " menat configurater" fi fi if [ ! -f $menat_h_t/cc.log ];then LANG=C echo "cc.log was created at `date '+%Y-%m-%d %a %H:%M'` by ${ma_user}(`id -un`)." >$menat_h_t/cc.log chmod -f 664 $menat_h_t/cc.log chgrp -f menat $menat_h_t/cc.log LANG=ja_JP.eucJP fi if [ -f $menat_h_t/cc.log ];then echo " キャプチャ履歴" fi echo "  ヘルプ

" echo $web_version $menat_version echo '
' exit 0 #2004-06-01 Wed 13:11 0.9.4-rc7 station link was implemented. #2004-05-27 Fri 18:53 0.9.3 multi video cards support was implemented officially. #2004-05-21 Sat 01:27 0.9.1-pre2 tlong flexibility was improved. #2004-05-19 Thu 01:31 0.9.0-pre2 new ls compatibility. #2004-05-17 Tue 23:54 0.9.0-pre1 mop0 viewer was implemented. #2004-05-05 Thu 13:30 0.8.13-rc2 file existance test was revised. #2004-04-27 Wed 07:39 0.8.12 blink was revised. #2004-04-24 Sun 03:44 0.8.11 file name batting bug was fixed. #2004-04-21 Thu 08:00 0.8.9 stable version was released. #2004-04-12 Tue 04:46 0.8.7 org_menat_h_t bug was fixed. #2004-04-01 Fri 17:05 0.8.4 Extend option was implemented. #2004-03-27 Tue 00:56 0.8.1 progchk -d option compatibility was implemented. #2004-03-27 Sun 12:46 0.8.0 stable version new 0.8.x series started. #2004-03-24 Thu 09:01 0.7.9 log view was implemented. #2004-03-21 Mon 20:00 0.7.7 reload option was implemented. #2004-03-21 Mon 20:00 0.7.4 station link was implemented. #2004-03-21 Mon 12:07 0.7.3 sad_ok was implemented for security reason. #2004-03-20 Sun 14:01 0.7.2 buggy reload was fixed and nonsense break were removed. #2004-03-12 Sat 14:45 0.7.0 first 0.7.x series official release for menat stable version. #2004-03-03 Thu 03:05 0.6.14 table reload exception error was revised. #2004-03-02 Wed 15:14 0.6.13 chennel menue was implemented. #2004-03-01 Tue 12:03 0.6.7 iepg infomation was implemented. #2004-02-25 Fri 22:03 0.6.1b END_TIME routine and prog.db was revised. #2004-02-25 Fri 08:38 0.6.1-pre1 mtq extension was added,new blunch started. #2004-02-24 Thu 22:27 0.5.3 -lt typo was fixed and first release 0.5.3. #2004-02-07 Sun 22:21 0.4.9b color.conf was added,and ma_ext was revised. #2004-02-06 Sun 19:00 0.4.8 first official release.