#!/bin/sh1# Copyright (c) Oct 2024 Wolfram Schneider <[email protected]>2# SPDX-License-Identifier: BSD-2-Clause3#4# absolute-symlink.sh - check for absolute symlinks on a FreeBSD system5#6# The purpose of this script is to detect absolute symlinks on7# a machine, e.g.:8#9# /etc/localtime -> /usr/share/zoneinfo/UTC10#11# Some of these absolute symbolic links can be created intentionally,12# but it is usually better to use relative symlinks.13#14# You can run the script after `make installworld', or any other15# make targets thats installs files.16#17# You can also check your local ports with:18#19# env ABSOLUTE_SYMLINK_DIRS=/usr/local ./absolute-symlink.sh202122PATH="/bin:/usr/bin"; export PATH23LANG="C"; export LANG2425# check other directories as well26: ${ABSOLUTE_SYMLINK_DIRS=""}2728find -s -H \29/bin \30/boot \31/etc \32/lib \33/libexec \34/sbin \35/usr/bin \36/usr/include \37/usr/lib \38/usr/lib32 \39/usr/libdata \40/usr/libexec \41/usr/sbin \42/usr/src \43/usr/share \44$ABSOLUTE_SYMLINK_DIRS \45-type l \46-ls | grep -Ea -- ' -> /'4748#EOF495051