Fix trailing whitespaces in files

This commit is contained in:
jo 2021-05-27 16:33:20 +02:00
parent 1af089219f
commit d8195f0fd8
46 changed files with 240 additions and 241 deletions

View file

@ -16,27 +16,27 @@ post_file() {
mv "${file_path}" "${stripped_file_path}"
file_path="${stripped_file_path}"
filename="${file_path##*/}"
airtime_conf_path=/etc/airtime/airtime.conf
#instance_path will look like 1/1384, for example
http_path=$(grep base_url ${airtime_conf_path} | awk '{print $3;}' )
http_port=$(grep base_port ${airtime_conf_path} | awk '{print $3;}' )
http_port=$(grep base_port ${airtime_conf_path} | awk '{print $3;}' )
#post request url - http://bananas.airtime.pro/rest/media, for example
url=http://
url+=$http_path
url+=:
url+=$http_port
url+=/rest/media
api_key=$(grep api_key ${airtime_conf_path} | awk '{print $3;}' )
api_key=$(grep api_key ${airtime_conf_path} | awk '{print $3;}' )
# -f is needed to make curl fail if there's an HTTP error code
# -L is needed to follow redirects! (just in case)
until curl -fL --max-time 30 $url -u $api_key":" -X POST -F "file=@${file_path}"
until curl -fL --max-time 30 $url -u $api_key":" -X POST -F "file=@${file_path}"
do
retry_count=$[$retry_count+1]
if [ $retry_count -ge $max_retry ]; then

View file

@ -21,8 +21,8 @@ if ($argc <= 1)
exit();
}
$message = $argv[1];
$message = $argv[1];
$connection = new AMQPConnection(HOST, PORT, USER, PASS, VHOST);
if (!isset($connection))
{
@ -31,10 +31,10 @@ if (!isset($connection))
}
$channel = $connection->channel();
// declare/create the queue
$channel->queue_declare($queue, false, true, false, false);
// declare/create the exchange as a topic exchange.
$channel->exchange_declare($exchange, $exchangeType, false, true, false);

View file

@ -3,7 +3,7 @@
post_file() {
file_path=${1}
filename="${file_path##*/}"
#kill process after 30 minutes (360*5=30 minutes)
max_retry=10
retry_count=0