#!/bin/bash
# Copyright (C) 2008 - 2012 vortexbox.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# Changelog:
#
# Thurs Jun 23 2011 Ron Olsen <ronolsen@comcast.net>
# * Delete /etc/vortexbox/backup.running and /etc/vortexbox/restore.running on reboot.

# Clean up old temp files
tmpwatch -au 1 /tmp
rm -f /etc/vortexbox/mirror-flac-mp3.*
rm -f /etc/vortexbox/mirror-flac-aac.*
rm -f /etc/vortexbox/backup.running /etc/vortexbox/restore.running

# Clean up permissions
chmod -R 777 /etc/vortexbox/
chmod -R 777 /storage/music/
chown -R apache:apache /var/www/
chmod -R 777 /opt/account/
chmod -R 777 /opt/vortexbox/rip/
chmod -R 777 /etc/ripit/
chown -R squeezeboxserver:squeezeboxserver /storage/music/playlist/

chmod 755 /opt/vortexbox/motd.sh && /opt/vortexbox/motd.sh > /etc/issue


/opt/vortexbox/networkcheck.sh &