my $ECHO = `which echo | tr -d '\n'`;
my $SLEEP = `which sleep | tr -d '\n'`;
my $RM = `which rm | tr -d '\n'`;
+my $CHMOD = `which chmod | tr -d '\n'`;
# 動作モード
-my $is_check_mode = 0;
-my $is_conv_to_mp3 = 1;
-my $SLEEP_TIME_SEC = 5;
+my $is_check_mode = 0;
+my $is_conv_to_mp3 = 1;
+my $SLEEP_TIME_SEC = 5;
+my $FILE_PERMISSION = 644;
# コマンド構築
-my $rec_cmd = "cd $ENV{RADIKO_SAVE_TO} ; $RADISH -t radiko -s $station -d $min -o $m4a ; ";
+my $rec_cmd = "cd $ENV{RADIKO_SAVE_TO}; $RADISH -t radiko -s $station -d $min -o $m4a; $CHMOD $FILE_PERMISSION $m4a; ";
if ($is_conv_to_mp3) {
- $rec_cmd .= "$FFMPEG -i $m4a $mp3 &> /dev/null ; $SLEEP $SLEEP_TIME_SEC ; if [ -s $mp3 ]; then $RM $m4a; fi";
+ $rec_cmd .= "$FFMPEG -i $m4a $mp3 &> /dev/null; $SLEEP $SLEEP_TIME_SEC; ".
+ "if [ -s $mp3 ]; then $RM $m4a; $CHMOD $FILE_PERMISSION $mp3; fi";
}
my $at_time = sprintf('%d:%02d %02d.%02d.%02d', $time_h, $time_m, $d, $m, ($y - int($y/100)*100 ) );