#!/bin/bash
# This script is written by Angel Berlanas Vicente
# <angel.berlanas@gmail.com>, and is licensed under
# GPL v3 or higher
# 
# This is a simple script to maintain several 
# considerations about the permissions under /boot/
# 
# First :
#  - If permissions is not setted to 644
#    the images is not correctly readed


_migrate()
{
  # Fix the kernel permissions for 
  # /boot/*3.*" 
  # kernels
  for f in $(ls -1 /boot/*3.*) ; do 
    [ ! -f  $f ] || chmod 644 "$f"
  done
}

_show_info()
{
  echo "Fix permissions of boot kernels: 3.* "
}


#
# MAIN script
#
case $1 in 
  migrate)
    _migrate
  ;;
  info)
    _show_info
  ;;
    *)
  ;;
esac

exit 0