#!/bin/bash

# define alias to python based on the below checks
[[ -f /usr/bin/python3 ]] && alias python=/usr/bin/python3 || { [[ -f /usr/bin/python2 ]] && alias python=/usr/bin/python2 || { [[ -f /usr/bin/python ]] && alias python=/usr/bin/python; }; }
shopt -s expand_aliases

RCFILE="/usr/lib/supportconfig/resources/scplugin.rc"
: ${PLOG_LINES:=500}
[ -s $RCFILE ] && . $RCFILE || { echo "ERROR: Initializing resource file: $RCFILE"; exit 1; }
validate_rpm vabase-appbase
validate_rpm yast2-vabase-vainit
validate_rpm vabase-build-keys
validate_rpm vabase-commonservices
validate_rpm vabase-datamodel
plugin_command systemctl status vabase-datamodel
plugin_command systemctl status vabase-jetty
plugin_command ss -planet
plugin_command df -h
plugin_command mount
plugin_command 'rpm -qa | sort'
plugin_command ls /root
plugin_command unzip -l /vastorage/conf/vaconfig.zip
plugin_command keytool -list -v -keystore /var/lib/ca-certificates/java-cacerts -storepass changeit
pconf_files /etc/Novell-VA-release /etc/sysconfig/novell/NvlVAinit /etc/sysconfig/memcached /opt/novell/base_config/buildTimeRPMs
plog_files ${PLOG_LINES} /var/opt/novell/jetty/logs/jetty.stderrout.out
cp /opt/novell/base_config/*.zip ${LOG}
cp /var/opt/novell/jetty/logs/* ${LOG}
cp /var/opt/novell/datamodel-service/logs/* ${LOG}
cp /var/opt/novell/python/logs/* ${LOG}
cp /var/log/YaST2/y2log ${LOG}
cp /usr/share/YaST2/include/novell-vainit/va_log ${LOG}
ls -l /var/opt/novell/jetty/dumps
ls -l /var/opt/novell/datamodel-service/dumps
python /opt/novell/base_config/getApplianceCommonVersionNumber.py
cp /var/opt/novell/va/logs/suse_register.log ${LOG}


