pmaports/temp/dhcpcd/dhcpcd.post-upgrade
JuniorJPDJ 67ceee4079
temp/dhcpcd: fix for old kernels (!228)
Fork the package from Alpine and undefine IFA_F_NOPREFIXROUTE during
compilation, so it works with the old downstream kernels that do not
have this feature yet.
2019-02-28 13:43:28 +01:00

24 lines
619 B
Bash

#!/bin/sh
ver_new="$1"
ver_old="$2"
# Move dhcpcd.duid and dhcpcd.secret to new location when upgrading
# to dhcpcd 7.x.
# See https://roy.marples.name/blog/dhcpcd-7-finally-enters-beta.
if [ "$(apk version -t "$ver_old" '7.0.0-r0')" = '<' ]; then
dbdir='/var/lib/dhcpcd'
duid_old='/etc/dhcpcd.duid'
secret_old='/etc/dhcpcd.secret'
if [ -f $duid_old ] && [ ! -f $dbdir/duid ]; then
echo "* Moving $duid_old to $dbdir/duid" >&2
mv $duid_old $dbdir/duid
fi
if [ -f $secret_old ] && [ ! -f $dbdir/secret ]; then
echo "* Moving $secret_old to $dbdir/secret" >&2
mv $secret_old $dbdir/secret
fi
fi
exit 0