16 lines
485 B
PHP
16 lines
485 B
PHP
# The home-server project produces a multi-purpose setup using Ansible.
|
||
# Copyright © 2018–2023 Y. Gablin, under the GPL-3.0-or-later license.
|
||
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
|
||
|
||
if [ ${0:0:1} == / ]; then
|
||
this="$0"
|
||
elif [[ "$0" =~ / ]]; then
|
||
this="$PWD/$0"
|
||
else
|
||
this="$(which "$0")"
|
||
fi
|
||
if [ "${this#/usr/}" == "$this" ]; then
|
||
exec arch-chroot "${this%/usr/*}" "/usr/${this##*/usr/}" "$@"
|
||
fi
|
||
unset this
|