File manager - Edit - /var/lib/dpkg/info/squid.postinst
Back
#! /bin/sh set -e grepconf () { w=" " # space tab # sed is cool. res=`squid -k parse 2>&1 | grep "Processing:" | sed s/.*Processing:\ // | sed -ne ' s/^'$1'['"$w"']\+\([^'"$w"']\+\).*$/\1/p; t end; d; :end q'` [ -n "$res" ] || res=$2 echo "$res" } grepconf2 () { w=" " # space tab # sed is cool. res=`squid -k parse 2>&1 | grep "Processing:" | sed s/.*Processing:\ // | sed -ne ' s/^'$1'['"$w"']\+[^'"$w"']\+['"$w"']\+\([^'"$w"']\+\).*$/\1/p; t end; d; :end q'` [ -n "$res" ] || res=$2 echo "$res" } case "$1" in configure) # # Chown the directories. # log_dir=/var/log/squid cache_dir=`grepconf2 cache_dir /var/spool/squid` usr=`grepconf cache_effective_user proxy` grp=`grepconf cache_effective_group proxy` if [ "$(stat -c %U $cache_dir)" != "$usr" ] || [ "$(stat -c %G $cache_dir)" != "$grp" ] ; then chown $usr:$grp $cache_dir fi if [ "$(stat -c %U $log_dir)" != "$usr" ] || [ "$(stat -c %G $log_dir)" != "$grp" ] ; then if [ "$(dpkg-statoverride --list $log_dir)" = "" ] ; then chown $usr:$grp $log_dir fi fi # If we have setcap is installed, try setting cap_net_raw+ep, # which allows us to install our binaries without the setuid # bit. PINGER=/usr/lib/squid/pinger if command -v setcap > /dev/null; then if setcap cap_net_raw+ep $PINGER; then echo "Setcap worked! $PINGER is not suid!" else echo "Setcap failed on $PINGER, falling back to setuid" >&2 chmod u+s $PINGER fi else echo "Setcap is not installed, falling back to setuid" >&2 chmod u+s $PINGER fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) # # Unknown action - do nothing. # exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_apparmor/2.13.6-10 if [ "$1" = "configure" ]; then APP_PROFILE="/etc/apparmor.d/usr.sbin.squid" if [ -f "$APP_PROFILE" ]; then # Add the local/ include LOCAL_APP_PROFILE="/etc/apparmor.d/local/usr.sbin.squid" test -e "$LOCAL_APP_PROFILE" || { mkdir -p `dirname "$LOCAL_APP_PROFILE"` install --mode 644 /dev/null "$LOCAL_APP_PROFILE" } # Reload the profile, including any abstraction updates if aa-enabled --quiet 2>/dev/null; then apparmor_parser -r -T -W "$APP_PROFILE" || true fi fi fi # End automatically added section # Automatically added by dh_installsystemd/13.3.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # In case this system is running systemd, we need to ensure that all # necessary tmpfiles (if any) are created before starting. if [ -d /run/systemd/system ] ; then systemd-tmpfiles --create squid.conf >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installdeb/13.3.4 dpkg-maintscript-helper rm_conffile /etc/squid3/msntauth.conf 3.5.4-1\~ squid3 -- "$@" dpkg-maintscript-helper mv_conffile /etc/squid3/squid.conf /etc/squid/squid.conf 3.5.4-1\~ squid3 -- "$@" dpkg-maintscript-helper mv_conffile /etc/squid3/errorpage.css /etc/squid/errorpage.css 3.5.4-1\~ squid3 -- "$@" # End automatically added section # Automatically added by dh_installinit/13.3.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "/etc/init.d/squid" ]; then update-rc.d squid defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d --skip-systemd-native squid $_dh_action || exit 1 fi fi # End automatically added section # Automatically added by dh_installsystemd/13.3.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'squid.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'squid.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'squid.service' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'squid.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.3.4 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'squid.service' >/dev/null || true fi fi # End automatically added section exit 0
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.63 |
proxy
|
phpinfo
|
Settings