-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·40 lines (33 loc) · 878 Bytes
/
install.sh
File metadata and controls
executable file
·40 lines (33 loc) · 878 Bytes
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
#!/bin/bash
# Color codes
RED='\033[0;31m'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
END='\033[0m'
# Check if debug mode is enabled
DEBUG=false
if [ "$1" == "-d" ]; then
DEBUG=true
shift
fi
# Define variables
BIN_PATH="/usr/bin/fmk"
SCRIPT_PATH="$(pwd)/fmk.sh"
# Check if the script file exists
if [ ! -f "$SCRIPT_PATH" ]; then
echo -e "${RED}[-]${END} Script file fmk.sh not found in the current directory."
exit 1
fi
# Install the script to /usr/bin
if $DEBUG; then
sudo cp "$SCRIPT_PATH" "$BIN_PATH"
sudo chmod +x "$BIN_PATH"
else
sudo cp "$SCRIPT_PATH" "$BIN_PATH" >/dev/null
sudo chmod +x "$BIN_PATH" >/dev/null
fi
if [ $? -ne 0 ]; then
echo -e "${RED}[-]${END} Failed to install the script to /usr/bin."
exit 1
fi
echo -e "${GREEN}[+]${END} The script has been installed to /usr/bin as 'fmk'. You can now use the 'fmk' command from any directory."