⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
var
/
lib
/
dpkg
/
info
/
View File Name :
sw-cp-server.postinst
### Copyright 1999-2025. WebPros International GmbH. All rights reserved. [ -z "$PLESK_INSTALLER_DEBUG" ] || set -x [ -z "$PLESK_INSTALLER_STRICT_MODE" ] || set -e detect_and_setup_ipv6_support() { # setup ipv6 if it's available [ -f /proc/net/if_inet6 ] && grep -Eq "\w" /proc/net/if_inet6 || return 0 cat > "/etc/sw-cp-server/conf.d/ipv6_ports.inc" << EOF listen [::]:8443 ipv6only=on ssl; listen [::]:8880 ipv6only=on; EOF } sw_cp_server_graceful_upgrade() { local pidfile="/var/run/sw-cp-server.pid" local pidfile_old="/var/run/sw-cp-server.pid.oldbin" local pid # make sw-cp-server to spawn new master process pid=$(egrep -xm1 '[0-9]+' "$pidfile" 2>/dev/null) || return 1 kill -s USR2 "$pid" local i=0 # Wait for both old and new master to write their pid file while ! [ -s "$pidfile" -a -s "$pidfile_old" ]; do i=$((i+1)) ! [ $i -ge 10 ] || return 1 sleep 1 done # stop old master process pid=$(egrep -xm1 '[0-9]+' "$pidfile_old" 2>/dev/null) || return 1 kill -s QUIT "$pid" i=0 while [ -s "$pidfile_old" ]; do i=$((i+1)) ! [ $i -ge 10 ] || return 1 sleep 1 done return 0 } sw_cp_server_upgrade() { # upgrade isn't required if sw-cp-server isn't active /bin/systemctl is-active sw-cp-server.service -q || return 0 # do not restart sw-cp-server if config check is failed local msg rc=0 msg=$(/usr/sbin/sw-cp-serverd -t) || rc=$? if [ $rc -ne 0 ]; then echo "$msg" >&2 echo "sw-cp-server has not restarted during upgrade due to failure of configuration test" >&2 return $rc fi if ! sw_cp_server_graceful_upgrade; then echo "Unable to restart sw-cp-server gracefully, performing full restart" >&2 /bin/systemctl restart sw-cp-server.service || return $? fi return 0 } case "$1" in configure) detect_and_setup_ipv6_support if [ -n "$2" ]; then sw_cp_server_upgrade || : fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac exit 0 # vim:ft=sh: