#!/bin/sh

# Vavoo Stream Live - Post Installation Script
# Author: Lululla
# License: CC BY-NC-SA 4.0

print_header() {
    echo "############################################################"
    echo "#                                                          #"
    echo "#  Vavoo Stream Live Plugin - Installation Complete        #"
    echo "#  Author: Lululla (https://github.com/Belfagor2005)       #"
    echo "#  License: CC BY-NC-SA 4.0                                #"
    echo "#                                                          #"
    echo "############################################################"
}

print_features() {
    echo "🚀 Features Available:"
    echo "  ✓ Live TV Streaming from multiple servers"
    echo "  ✓ Countries & Categories view modes"
    echo "  ✓ Hierarchical bouquet export"
    echo "  ✓ Built-in search functionality"
    echo "  ✓ Automatic updates"
    echo "  ✓ Customizable interface"
}

print_usage() {
    echo "📱 How to Access:"
    echo "  • Main Menu → Plugins → Vavoo Stream Live"
    echo "  • Or via dedicated button in extensions"
    echo ""
    echo "⚙️  Configuration:"
    echo "  • Access settings from plugin menu"
    echo "  • Configure servers, DNS, and update intervals"
    echo "  • Customize view preferences and player settings"
}

print_footer() {
    echo "############################################################"
    echo "#                                                          #"
    echo "#  Important Next Steps:                                   #"
    echo "#                                                          #"
    echo "#  1. RESTART ENIGMA2 to activate the plugin               #"
    echo "#  2. Access via Main Menu → Plugins                       #"
    echo "#  3. Configure your preferences in plugin settings        #"
    echo "#                                                          #"
    echo "#  Support & Documentation:                                #"
    echo "#  https://github.com/Belfagor2005/vavoo                   #"
    echo "#                                                          #"
    echo "#  Thank you for choosing Vavoo Stream Live!               #"
    echo "#                                                          #"
    echo "############################################################"
}

print_header
echo ""
print_features
echo ""
print_usage
echo ""
print_footer

# Set proper permissions
echo "Setting file permissions..."
find /usr/lib/enigma2/python/Plugins/Extensions/vavoo -type f -exec chmod 644 {} \; > /dev/null 2>&1
find /usr/lib/enigma2/python/Plugins/Extensions/vavoo -type d -exec chmod 755 {} \; > /dev/null 2>&1
echo "✓ File permissions set correctly"

# Check if restart is needed
echo ""
echo "⚠️  IMPORTANT: Please restart Enigma2 to complete the installation"
echo "   This ensures all plugin components are properly loaded"

exit 0
