Add distro-specific, update "unsuppported" message

This commit is contained in:
askiiart 2023-09-06 20:54:23 -05:00
parent af69964db4
commit 29d500bfd5
No known key found for this signature in database
GPG key ID: 85505F3A2264FA01
5 changed files with 29 additions and 4 deletions

View file

@ -31,7 +31,7 @@ elif command_exists "apk"; then
sudo apk add pass
sudo apk add git
else
echo "Unsupported: unknown package manager"
echo "Unsupported: unknown package manager and distro"
fi
# Check if GCM is installed

25
distro-specific.bash Normal file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e
if [ $(whoami) == "root" ]; then
echo "Run as a normal user, not root"
exit 1
fi
command_exists() { type "$1" &>/dev/null; }
if command_exists "apt-get"; then
;
elif command_exists "yum"; then
;
elif command_exists "pacman"; then
;
elif command_exists "zypp"; then
# Untested
;
elif command_exists "emerge"; then
;
elif command_exists "apk"; then
;
else
echo "Unsupported: unknown package manager and distro"
fi

View file

@ -25,6 +25,6 @@ elif command_exists "apk"; then
sudo rc-update add libvirtd
sudo rc-service libvirtd start
else
echo "Unsupported: unknown package manager"
echo "Unsupported: unknown package manager and distro"
fi

View file

@ -37,7 +37,7 @@ elif command_exists "emerge"; then
elif command_exists "apk"; then
PM="apk"
else
>&2 echo "Unsupported: unknown package manager"
>&2 echo "Unsupported: unknown package manager and distro"
exit 1
fi

View file

@ -26,7 +26,7 @@ elif command_exists "emerge"; then
elif command_exists "apk"; then
sudo apk add zsh -y
else
echo >&2 "Unsupported: unknown package manager"
echo >&2 "Unsupported: unknown package manager and distro"
exit 1
fi