Bash скрипт очищающий swap

14/12/16
#!/bin/bash

free_data="$(free)"
mem_data="$(echo "$free_data" | grep 'Mem:')"
free_mem="$(echo "$mem_data" | awk '{print $4}')"
buffers="$(echo "$mem_data" | awk '{print $6}')"
cache="$(echo "$mem_data" | awk '{print $7}')"
total_free=$((free_mem + buffers + cache))
used_swap="$(echo "$free_data" | grep 'Swap:' | awk '{print $3}')"

echo -e "Free memory:\t$total_free kB ($((total_free / 1024)) MB)\nUsed swap:\t$used_swap kB ($((used_swap / 1024)) MB)"
if [[ $used_swap -eq 0 ]]; then
echo "Congratulations! No swap is in use."
elif [[ $used_swap -lt $total_free ]]; then
echo "Freeing swap..."
sudo swapoff -a
sudo swapon -a
else
echo "Not enough free memory. Exiting."
exit 1
fi

FreePBX 2.9.0 HTML5 player

22/11/16

Открываем файл /var/www/html/admin/modules/cdr/cdr_play.php
Находим строчку:

echo("<embed width='100%' type='audio/basic' src='modules/cdr/cdr_audio.php?cdr_file=" .$file. "' width=300, height=25 autoplay=true loop=false></embed><br>");

заменяем на:

echo("<audio controls src='modules/cdr/cdr_audio.php?cdr_file=" .$file. "'</audio><br>");
Главная