-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
59 lines (56 loc) · 1.67 KB
/
install.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
# Function to build the package
build_pkg() {
echo "-> Changing file name..."
mv ralsay.lua ralsay
echo "-> Making file executable..."
chmod +x ralsay
echo "-> Copying file to '/usr/local/bin'... Requires SUDO permissions"
sudo cp ralsay /usr/local/bin
echo "-! Ralsay package installed! Thank you for installing my package."
}
# Function to check the OS
check_os() {
if [ "$(uname)" = "FreeBSD" ]; then
# Check for FreeBSD
echo "-> Installing lua53 via pkg..."
sudo pkg install lua53
echo "-> Creating symlink for lua53"
sudo ln -s /usr/local/bin/lua53 /usr/local/bin/lua
build_pkg
elif [ "$(uname)" = "Darwin" ]; then
# Check for macOS
echo "-> Installing lua via brew..."
brew install lua
build_pkg
elif [ -f /etc/os-release ]; then
# Check for Fedora or Debian-based systems
. /etc/os-release
case "$ID" in
fedora)
echo "-> Installing lua via dnf..."
sudo dnf install lua
build_pkg
;;
debian)
echo "-> Installing lua via apt..."
sudo apt install lua
build_pkg
;;
ubuntu)
echo "-> Installing lua via apt..."
sudo apt install lua
build_pkg
;;
*)
echo "-! Unknown Linux distribution, Building PKG..."
build_pkg
;;
esac
else
echo "-! Unknown operating system, Running POSIX sh build PKG..."
build_pkg
fi
}
# Call the function
check_os