-
Notifications
You must be signed in to change notification settings - Fork 0
/
alhp-install
executable file
·34 lines (25 loc) · 1.08 KB
/
alhp-install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh -e
if ! [ -f "/lib/ld-linux-x86-64.so.2" ]; then
echo "Architecture is not x86-64."
exit 1
fi
ARCH=""
if /lib/ld-linux-x86-64.so.2 --help | grep -q 'x86-64-v4 (supported, searched)'; then
ARCH='x86-64-v4'
elif /lib/ld-linux-x86-64.so.2 --help | grep -q 'x86-64-v3 (supported, searched)'; then
ARCH='x86-64-v3'
elif /lib/ld-linux-x86-64.so.2 --help | grep -q 'x86-64-v2 (supported, searched)'; then
ARCH='x86-64-v2'
else
echo "Architecture is not supported."
exit 1
fi
echo "Supported architecture: $ARCH"
pkgs install alhp-keyring alhp-mirrorlist
PACMAN_CONF="/etc/pacman.conf"
ALHP_MIRRORLIST="/etc/pacman.d/alhp-mirrorlist"
grep -qxF "[core-$ARCH]" "$PACMAN_CONF" || sudo sed -i "/^[^#]*\[core\]/i [core-$ARCH]\nInclude = $ALHP_MIRRORLIST\n" $PACMAN_CONF
grep -qxF "[extra-$ARCH]" "$PACMAN_CONF" || sudo sed -i "/^[^#]*\[extra\]/i [extra-$ARCH]\nInclude = $ALHP_MIRRORLIST\n" "$PACMAN_CONF"
grep -qxF "[multilib-$ARCH]" "$PACMAN_CONF" || sudo sed -i "/^[^#]*\[multilib\]/i [multilib-$ARCH]\nInclude = $ALHP_MIRRORLIST\n" "$PACMAN_CONF"
pkgs upgrade
echo "alhp-install done."