|
|
08abde |
#!/bin/bash
|
|
|
08abde |
#
|
|
|
08abde |
# verify_doLinks.sh -- This function verifies required links your
|
|
|
08abde |
# workstation needs in order to run the centos-art command correctly.
|
|
|
08abde |
# If any required link is missing, the `centos-art.sh' script asks you
|
|
|
08abde |
# to confirm their installation. When installing links, the
|
|
|
08abde |
# `centos-art.sh' script uses the `ln' command to achieve the task.
|
|
|
08abde |
#
|
|
|
72c8a5 |
# Copyright (C) 2009-2011 Alain Reguera Delgado
|
|
|
08abde |
#
|
|
|
7cd8e9 |
# This program is free software; you can redistribute it and/or
|
|
|
7cd8e9 |
# modify it under the terms of the GNU General Public License as
|
|
|
7cd8e9 |
# published by the Free Software Foundation; either version 2 of the
|
|
|
7cd8e9 |
# License, or (at your option) any later version.
|
|
|
08abde |
#
|
|
|
08abde |
# This program is distributed in the hope that it will be useful, but
|
|
|
08abde |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
08abde |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
08abde |
# General Public License for more details.
|
|
|
08abde |
#
|
|
|
08abde |
# You should have received a copy of the GNU General Public License
|
|
|
08abde |
# along with this program; if not, write to the Free Software
|
|
|
08abde |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
08abde |
# USA.
|
|
|
08abde |
#
|
|
|
08abde |
# ----------------------------------------------------------------------
|
|
|
08abde |
# $Id$
|
|
|
08abde |
# ----------------------------------------------------------------------
|
|
|
08abde |
|
|
|
08abde |
function verify_doLinks {
|
|
|
08abde |
|
|
|
08abde |
local -a LINKS
|
|
|
08abde |
local -a TARGETS
|
|
|
08abde |
local -a LINKS_MISSING
|
|
|
08abde |
local LINKS_MISSING_ID=''
|
|
|
08abde |
|
|
|
08abde |
# Define link names.
|
|
|
08abde |
LINKS[0]=/home/centos/bin/centos-art
|
|
|
08abde |
LINKS[1]=/home/centos/.fonts/denmark.ttf
|
|
|
08abde |
LINKS[2]=/home/centos/.inkscape/palettes/CentOS.gpl
|
|
|
08abde |
LINKS[3]=/home/centos/.$(rpm -q gimp | cut -d. -f-2)/palettes/CentOS.gpl
|
|
|
08abde |
LINKS[4]=/home/centos/artwork/branches/Scripts
|
|
|
08abde |
|
|
|
08abde |
# Define link targets. Use array index as reference to know
|
|
|
08abde |
# relation between link names and targets. Be sure both link names
|
|
|
08abde |
# and link targets use the same array index value.
|
|
|
08abde |
TARGETS[0]=/home/centos/artwork/trunk/Scripts/Bash/centos-art.sh
|
|
|
08abde |
TARGETS[1]=/home/centos/artwork/trunk/Identity/Fonts/Ttf/denmark.ttf
|
|
|
08abde |
TARGETS[2]=/home/centos/artwork/trunk/Identity/Colors/CentOS.gpl
|
|
|
08abde |
TARGETS[3]=${TARGETS[2]}
|
|
|
08abde |
TARGETS[4]=/home/centos/artwork/trunk/Scripts/
|
|
|
08abde |
|
|
|
08abde |
verify_doLinkCheck
|
|
|
08abde |
verify_doLinkReport
|
|
|
08abde |
verify_doLinkInstall
|
|
|
08abde |
|
|
|
08abde |
# At this point all required links must be installed. To confirm
|
|
|
08abde |
# required links installation let's verify them once more.
|
|
|
08abde |
verify_doLinks
|
|
|
08abde |
|
|
|
08abde |
}
|