-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
33 lines (26 loc) · 961 Bytes
/
Copy pathsetup.sh
File metadata and controls
33 lines (26 loc) · 961 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
#!/bin/bash
# Check if running as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
# Check if the repository directory already exists
REPO_DIR="android-connect"
if [ -d "$REPO_DIR" ]; then
echo "Repository already cloned. Proceeding with installation..."
else
# Clone the repository
git clone https://github.com/yourusername/android-connect.git
fi
# Move the script to /usr/local/bin
mv ${REPO_DIR}/android_connect.sh /usr/local/bin/android_connect
# Make the script executable
chmod +x /usr/local/bin/android_connect
# Clean up if the repository was cloned by this script
if [ ! -d "$REPO_DIR" ]; then
echo "Installation complete. You can now run the script using the command 'android_connect'."
else
# Clean up the repository directory
rm -rf ${REPO_DIR}
echo "Installation complete. Repository directory cleaned up. You can now run the script using the command 'android_connect'."
fi