Permalink
Browse files

New Version Released: 1.1

  • Loading branch information...
1 parent 84fbc01 commit 5e16781db38df11d56b18be185bbffbdf4a9eb5d Alexandru Stancu committed Jul 27, 2012
Showing with 44 additions and 14 deletions.
  1. +6 −0 README.md
  2. +3 −0 etc/init.d/xwiki.sh
  3. +26 −5 install.sh
  4. +7 −6 var/lib/xinit/functions
  5. +2 −3 var/lib/xinit/vars
View
@@ -26,6 +26,12 @@ Configuration is located in /etc/xinit/xinit.cfg with sensible defaults.
Change Log
==========
+### Xinit Version 1.1 - 27/07/2012 ###
+
+* a new functionality has been added to Xinit to migrate the old configuration (Xinit version <= 0.0.17) to the new version (Xinit >= 1.0)
+* a new files has been added var/lib/xinit/migrate
+* a new function to check dependencies has also been added. Dependencies can be checked using xwiki.sh --check-dep
+
### Xinit Version 1.0 - 28/05/2012 ###
* A new major version released
View
@@ -119,6 +119,9 @@ case "$1" in
check-install)
check_install
;;
+ check-dep)
+ check_dependencies
+ ;;
nagios-info)
nagios_info
;;
View
@@ -8,13 +8,19 @@
#################################
# load the function file
+if [[ ! -e var/lib/xinit/functions ]]; then
+
+echo "Error: I can't find var/lib/xinit/functions file."
+exit 12
+
+fi
+
. var/lib/xinit/functions
xinit_update ()
{
-# check the dependencies
-check_dependencies;
+
if [[ -e /var/lib/xinit/vars ]]; then
installed_xinit_version="`grep VERSION /var/lib/xinit/vars | cut -d = -f 2`"
@@ -45,6 +51,7 @@ check_dependencies;
xinit_install ()
{
+
# check dependencies
check_dependencies;
@@ -111,12 +118,26 @@ else
fi
}
+# Function used to migrate xinit conf (vers <= 0.0.17 ) to version >= 1.0
migrate()
{
OLD_CONFIGURATION_FILE='/etc/xinit/xinit.cfg';
+ NEW_CONFIGURATION_FILE='/etc/xinit/xinit.cfg.new'
DEFAULT_NEW_CONFIGURATION_FILE='var/lib/xinit/default.cfg';
- NEW_CONFIGURATION_FILE=$OLD_CONFIGURATION_FILE
- . var/lib/xinit/migrate $OLD_CONFIGURATION_FILE $DEFAULT_NEW_CONFIGURATION_FILE $NEW_CONFIGURATION_FILE
+
+ if [[ ! -e $OLD_CONFIGURATION_FILE ]]; then
+
+ echo "Error: I was not able to find old conf file $OLD_CONFIGURATION_FILE"
+ exit 13
+ fi
+
+ if [[ ! -e $DEFAULT_NEW_CONFIGURATION_FILE ]]; then
+
+ echo "Error: I was not able to find the default new file $DEFAULT_NEW_CONFIGURATION_FILE"
+ exit 14
+ fi
+
+ ./var/lib/xinit/migrate $OLD_CONFIGURATION_FILE $DEFAULT_NEW_CONFIGURATION_FILE $NEW_CONFIGURATION_FILE
}
case $1 in
@@ -131,7 +152,7 @@ case $1 in
;;
*)
echo ""
- echo " usage: ./install.sh [ --install | --update | --migrate]"
+ echo " usage: ./install.sh [ --install | --update | --migrate ]"
echo
exit 1
View
@@ -225,6 +225,7 @@ show_help ()
echo " test-proc Just test if check-proc works. No notifications or restart will be performed."
echo " test-openoffice Just test if OpenOffice Daemon is running or not. No actions are taken."
echo " check-install Check XWiki installation (based on standard installation)."
+ echo " check-dep Check all the dependencies commands Xinit needs to run."
echo " nagios-info Informations needed for Nagios to check XWiki availability will be printed."
echo " version Print Xinit and XWiki version."
echo
@@ -641,13 +642,13 @@ check_dependencies ()
RST=$(tput sgr0) # Reset
BOLD=$(tput bold)
- declare -a COMMANDS_TO_CHECK_FOR=('sed' 'awk' 'curl' 'wget' 'cut' 'grep' );
- for COMMAND in ${COMMANDS_TO_CHECK_FOR[@]}; do
- if command_exists ${COMMAND};then
- echo "${COMMAND}$RST is installed $BOLD$GREEN [OK]$RST";
+ for COMMAND in ${DEPEND_COMMANDS[@]}; do
+ echo "Checking ${COMMAND} command ... "
+ if command_exists ${COMMAND} ; then
+ echo "${BOLD}${GREEN}[OK]${RST}";
else
- echo "${COMMAND}$RST is NOT installed $BOLD$RED [ERROR]$RST";
- echo "Please install ${COMMAND} first and then rerun the checks";
+ echo "${BOLD}${RED}[NOT FOUND]${RST}";
+ echo "Please install ${COMMAND} command.";
exit 17;
fi
done
View
@@ -1,5 +1,4 @@
-
LIB_DIR="/var/lib/xinit"
LIBS_FILE="functions default.cfg check-xwiki-install"
FUNCTIONS_FILE="/var/lib/xinit/functions"
@@ -12,5 +11,5 @@ REQUEST_ERROR_OUTPUT="/var/tmp/xinit_http_output"
XWIKI_HOME="/usr/local/xwiki"
XWIKI_INIT="/etc/init.d/xwiki.sh"
MYSQL_HOME="/etc/mysql/"
-COMMANDS_TO_CHECK_FOR=('sed' 'awk' 'curl' 'wget' 'cut' 'grep' )
-VERSION=1.0
+DEPEND_COMMANDS=('sed' 'awk' 'curl' 'cut' 'grep' 'cat' 'pidof' 'ps' 'date' 'hostname' 'netstat' 'tr' 'uniq' 'sort' 'egrep' 'mysql' 'du' 'top' 'kill' 'wc' 'mailx' 'ifconfig' 'uptime' 'sleep' 'tput')
+VERSION=1.1

0 comments on commit 5e16781

Please sign in to comment.