HEX
Server: Apache/2.4.65 (Debian)
System: Linux srv39710 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
User: root (0)
PHP: 8.4.11
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Upload Files
File: /var/lib/dpkg/info/coremanager-pkg-mysql.preinst
#!/bin/bash
# preinst script for coremanager
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

COREDIR=/usr/local/mgr5
MGR=core

case "$1" in
	install)
	. ${COREDIR}/lib/pkgsh/core_pkg_funcs.sh

	if [ "#${ISPCONVERT}" = "#yes" ]; then
		exit 0
	fi
	
	if [ ! -d ${COREDIR}/etc ]; then
		# There is no coremgr dir
		exit 1
	fi
	mkdir -p ${COREDIR}/tmp
	if [ -z "${1}" ]; then
		# Empty arg"
		exit 1
	fi
	
	TMPCNF=/usr/local/mgr5/tmp/.$$.cnf
	CORECNF=/usr/local/mgr5/etc/my.cnf
	
	export PATH="${PATH}:/usr/sbin:/usr/bin:/bin:/sbin"
	Service ${MYSQL_SERVICE} start
	
	
	DLIST=$(check_connect)
	if [ $? -eq 0 ]; then
		if ! check_my_cnf ; then
			#Alarm! There is empty paswwd
			create_root_passwd
			create_coremgr_passwd
		fi
	fi
	DLIST=$(check_core_cnf)
	if [ $? -ne 0 ]; then
		OLDROOTPW=$(reset_root_passwd)
		create_coremgr_passwd
		restore_root_passwd ${OLDROOTPW}
	fi
	;;
	upgrade)
	;;
	abort-upgrade)
	;;
	
	*)
		echo "preinst called with unknown argument \`$1'" >&2
		exit 1
	;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.



exit 0