mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
add _archboot_check
This commit is contained in:
parent
bfbdb5e11d
commit
9b42c8113d
3 changed files with 12 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
. /usr/lib/archboot/common.sh
|
||||
_APPNAME=${0##*/}
|
||||
_usage () {
|
||||
echo "Check on missing binaries in archboot environment"
|
||||
|
@ -12,10 +13,7 @@ _usage () {
|
|||
exit 0
|
||||
}
|
||||
[[ -z "${1}" ]] && _usage
|
||||
if [[ ! "$(cat /etc/hostname)" == "archboot" ]]; then
|
||||
echo "This script should only be run in booted archboot environment. Aborting..."
|
||||
exit 1
|
||||
fi
|
||||
_archboot_check
|
||||
# update pacman db first
|
||||
pacman -Sy
|
||||
if [[ "${1}" == "base" ]]; then
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
if [[ ! "$(cat /etc/hostname)" == "archboot" ]]; then
|
||||
echo "This script should only be run in booted archboot environment. Aborting..."
|
||||
exit 1
|
||||
fi
|
||||
. /usr/lib/archboot/common.sh
|
||||
_archboot_check
|
||||
rm -r /usr/share/licenses
|
||||
pacman -Sy
|
||||
pacman -Q | cut -d ' ' -f1 >packages.txt
|
||||
|
|
|
@ -39,6 +39,14 @@ _root_check() {
|
|||
fi
|
||||
}
|
||||
|
||||
### check for x86_64
|
||||
_archboot_check() {
|
||||
if ! grep -qw 'archboot' /etc/hostname; then
|
||||
echo "This script should only be run in booted archboot environment. Aborting..."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
### check for x86_64
|
||||
_x86_64_check() {
|
||||
if ! [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
|
||||
|
|
Loading…
Reference in a new issue