|
| 1 | +# Automatically added by dh_systemd_enable/12.1.1 |
| 2 | +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then |
| 3 | + # This will only remove masks created by d-s-h on package removal. |
| 4 | + deb-systemd-helper unmask 'vyatta-routing-frr.target' >/dev/null || true |
| 5 | + |
| 6 | + # was-enabled defaults to true, so new installations run enable. |
| 7 | + if deb-systemd-helper --quiet was-enabled 'vyatta-routing-frr.target'; then |
| 8 | + # Enables the unit on first installation, creates new |
| 9 | + # symlinks on upgrades if the unit file has changed. |
| 10 | + deb-systemd-helper enable 'vyatta-routing-frr.target' >/dev/null || true |
| 11 | + else |
| 12 | + # Update the statefile to add new symlinks (if any), which need to be |
| 13 | + # cleaned up on purge. Also remove old symlinks. |
| 14 | + deb-systemd-helper update-state 'vyatta-routing-frr.target' >/dev/null || true |
| 15 | + fi |
| 16 | +fi |
| 17 | +# End automatically added section |
| 18 | +# Automatically added by dh_installinit/12.1.1 |
| 19 | +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then |
| 20 | + # In case this system is running systemd, we need to ensure that all |
| 21 | + # necessary tmpfiles (if any) are created before starting. |
| 22 | + if [ -d /run/systemd/system ] ; then |
| 23 | + systemd-tmpfiles --create vyatta-protocols-frr.conf >/dev/null || true |
| 24 | + fi |
| 25 | +fi |
| 26 | +# End automatically added section |
| 27 | +# Automatically added by dh_systemd_start/12.1.1 |
| 28 | +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then |
| 29 | + if [ -d /run/systemd/system ]; then |
| 30 | + systemctl --system daemon-reload >/dev/null || true |
| 31 | + deb-systemd-invoke start 'vyatta-frr-base-config.service' 'vyatta-routing-frr-early.target' 'vyatta-routing-frr.target' >/dev/null || true |
| 32 | + fi |
| 33 | +fi |
| 34 | +# End automatically added section |
| 35 | +# Automatically added by dh_configpackage/UNDECLARED |
| 36 | +# displace.sh.in: diversion helpers for maintainer scripts |
| 37 | +# |
| 38 | +# displace_link <prefix> <suffix> |
| 39 | +# |
| 40 | +# Ensures that the file <prefix><suffix> is properly diverted to |
| 41 | +# <prefix>.divert-orig<suffix> by this package, and becomes a |
| 42 | +# symbolic link to either <prefix>.divert<suffix> (default) or |
| 43 | +# <prefix>.divert-orig<suffix>. |
| 44 | +# |
| 45 | +# undisplace_unlink <prefix> <suffix> |
| 46 | +# |
| 47 | +# Undoes the action of displace_link <prefix> <suffix> specified |
| 48 | +# above. |
| 49 | +# |
| 50 | +# Version: 4.0 |
| 51 | +# |
| 52 | +# Copyright © 2008–2012 Tim Abbott < [email protected]> and Anders |
| 53 | + |
| 54 | +# |
| 55 | +# Permission is hereby granted, free of charge, to any person |
| 56 | +# obtaining a copy of this software and associated documentation files |
| 57 | +# (the “Software”), to deal in the Software without restriction, |
| 58 | +# including without limitation the rights to use, copy, modify, merge, |
| 59 | +# publish, distribute, sublicense, and/or sell copies of the Software, |
| 60 | +# and to permit persons to whom the Software is furnished to do so, |
| 61 | +# subject to the following conditions: |
| 62 | +# |
| 63 | +# The above copyright notice and this permission notice shall be |
| 64 | +# included in all copies or substantial portions of the Software. |
| 65 | +# |
| 66 | +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, |
| 67 | +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 68 | +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 69 | +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 70 | +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 71 | +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 72 | +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 73 | +# SOFTWARE. |
| 74 | +# |
| 75 | + |
| 76 | +package=vyatta-protocols-frr |
| 77 | + |
| 78 | +ours=.danos |
| 79 | +theirs=.danos-orig |
| 80 | + |
| 81 | +displace_link_divert() |
| 82 | +{ |
| 83 | + file=$1 |
| 84 | + ourfile=$2 |
| 85 | + theirfile=$3 |
| 86 | + if ! LC_ALL=C dpkg-divert --list "$package" | \ |
| 87 | + grep -xFq "diversion of $file to $theirfile by $package"; then |
| 88 | + dpkg-divert --divert "$theirfile" --rename --package "$package" --add "$file" |
| 89 | + fi |
| 90 | +} |
| 91 | + |
| 92 | +displace_link_symlink() |
| 93 | +{ |
| 94 | + file=$1 |
| 95 | + ourfile=$2 |
| 96 | + theirfile=$3 |
| 97 | + if [ ! -L "$file" ] && [ ! -e "$file" ]; then |
| 98 | + ln -s "$(basename "$ourfile")" "$file" |
| 99 | + elif [ ! -L "$file" ] || \ |
| 100 | + [ "$(readlink "$file")" != "$(basename "$ourfile")" -a \ |
| 101 | + "$(readlink "$file")" != "$(basename "$theirfile")" ]; then |
| 102 | + echo "*** OMINOUS WARNING ***: $file is not linked to either $(basename "$ourfile") or $(basename "$theirfile")" >&2 |
| 103 | + fi |
| 104 | +} |
| 105 | + |
| 106 | +displace_link() |
| 107 | +{ |
| 108 | + prefix=$1 |
| 109 | + suffix=$2 |
| 110 | + |
| 111 | + file=$prefix$suffix |
| 112 | + ourfile=$prefix$ours$suffix |
| 113 | + theirfile=$prefix$theirs$suffix |
| 114 | + displace_link_divert "$file" "$ourfile" "$theirfile" |
| 115 | + displace_link_symlink "$file" "$ourfile" "$theirfile" |
| 116 | +} |
| 117 | + |
| 118 | +displace_hide() |
| 119 | +{ |
| 120 | + file=$1 |
| 121 | + ourfile="" |
| 122 | + theirfile=$2 |
| 123 | + displace_link_divert "$file" "$ourfile" "$theirfile" |
| 124 | +} |
| 125 | + |
| 126 | +undisplace_unlink_symlink() |
| 127 | +{ |
| 128 | + file="$1" |
| 129 | + ourfile="$2" |
| 130 | + theirfile="$3" |
| 131 | + if [ ! -L "$file" ] || \ |
| 132 | + [ "$(readlink "$file")" != "$(basename "$ourfile")" -a \ |
| 133 | + "$(readlink "$file")" != "$(basename "$theirfile")" ]; then |
| 134 | + echo "*** OMINOUS WARNING ***: $file is not linked to either $(basename "$ourfile") or $(basename "$theirfile")" >&2 |
| 135 | + else |
| 136 | + rm -f "$file" |
| 137 | + fi |
| 138 | +} |
| 139 | + |
| 140 | +undisplace_unlink_divert() |
| 141 | +{ |
| 142 | + file="$1" |
| 143 | + if [ ! -L "$file" ] && [ ! -e "$file" ]; then |
| 144 | + dpkg-divert --remove --rename --package "$package" "$file" |
| 145 | + else |
| 146 | + echo "Not removing diversion of $file by $package" >&2 |
| 147 | + fi |
| 148 | +} |
| 149 | + |
| 150 | +undisplace_unlink() |
| 151 | +{ |
| 152 | + prefix=$1 |
| 153 | + suffix=$2 |
| 154 | + |
| 155 | + file=$prefix$suffix |
| 156 | + ourfile=$prefix$ours$suffix |
| 157 | + theirfile=$prefix$theirs$suffix |
| 158 | + |
| 159 | + undisplace_unlink_symlink "$file" "$ourfile" "$theirfile" |
| 160 | + undisplace_unlink_divert "$file" |
| 161 | +} |
| 162 | + |
| 163 | +undisplace_unhide() |
| 164 | +{ |
| 165 | + file=$1 |
| 166 | + undisplace_unlink_divert "$file" |
| 167 | +} |
| 168 | + |
| 169 | +check_undisplace_unlink() |
| 170 | +{ |
| 171 | + prefix=$1 |
| 172 | + suffix=$2 |
| 173 | + |
| 174 | + file=$prefix$suffix |
| 175 | + ourfile=$prefix$ours$suffix |
| 176 | + theirfile=$prefix$theirs$suffix |
| 177 | + |
| 178 | + if LC_ALL=C dpkg-divert --list "$package" | \ |
| 179 | + grep -xFq "diversion of $file to $theirfile by $package"; then |
| 180 | + undisplace_unlink "$prefix" "$suffix" |
| 181 | + fi |
| 182 | +} |
| 183 | + |
| 184 | +check_undisplace_unhide() |
| 185 | +{ |
| 186 | + file=$1 |
| 187 | + hiddenfile=$2 |
| 188 | + if LC_ALL=C dpkg-divert --list "$package" | \ |
| 189 | + grep -xFq "diversion of $file to $hiddenfile by $package"; then |
| 190 | + undisplace_unhide "$file" |
| 191 | + fi |
| 192 | +} |
| 193 | + |
| 194 | +# End of displace.sh.in |
| 195 | +if [ "$1" = "configure" ] || [ "$1" = "abort-remove" ]; then |
| 196 | + displace_link /etc/frr/daemons |
| 197 | +fi |
| 198 | +# End automatically added section |
0 commit comments