#!/bin/sh
# Copyright (C) 2015-2017 Algo Communication Products Ltd.

FILEDIR=$1

cd $FILEDIR
if [ -f *.zip ]; then
	unzip -o *.zip
	rm -rf *.zip
fi
# delete files with space in file name
rm -f *\ *

mv *.wav /opt/algo/web/tones/
rm -rf $FILEDIR/*

/opt/algo/bin/toneman-check
sync
