Add distro-specific, update "unsuppported" message
This commit is contained in:
parent
af69964db4
commit
29d500bfd5
5 changed files with 29 additions and 4 deletions
|
@ -31,7 +31,7 @@ elif command_exists "apk"; then
|
||||||
sudo apk add pass
|
sudo apk add pass
|
||||||
sudo apk add git
|
sudo apk add git
|
||||||
else
|
else
|
||||||
echo "Unsupported: unknown package manager"
|
echo "Unsupported: unknown package manager and distro"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if GCM is installed
|
# Check if GCM is installed
|
||||||
|
|
25
distro-specific.bash
Normal file
25
distro-specific.bash
Normal 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
|
|
@ -25,6 +25,6 @@ elif command_exists "apk"; then
|
||||||
sudo rc-update add libvirtd
|
sudo rc-update add libvirtd
|
||||||
sudo rc-service libvirtd start
|
sudo rc-service libvirtd start
|
||||||
else
|
else
|
||||||
echo "Unsupported: unknown package manager"
|
echo "Unsupported: unknown package manager and distro"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -37,7 +37,7 @@ elif command_exists "emerge"; then
|
||||||
elif command_exists "apk"; then
|
elif command_exists "apk"; then
|
||||||
PM="apk"
|
PM="apk"
|
||||||
else
|
else
|
||||||
>&2 echo "Unsupported: unknown package manager"
|
>&2 echo "Unsupported: unknown package manager and distro"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ elif command_exists "emerge"; then
|
||||||
elif command_exists "apk"; then
|
elif command_exists "apk"; then
|
||||||
sudo apk add zsh -y
|
sudo apk add zsh -y
|
||||||
else
|
else
|
||||||
echo >&2 "Unsupported: unknown package manager"
|
echo >&2 "Unsupported: unknown package manager and distro"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue