-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d27395
commit d8f89c9
Showing
1 changed file
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# run apt update to make sure the system is got latest repo files | ||
sudo apt update -y | ||
|
||
# Check if git is installed | ||
if ! command -v git &> /dev/null; then | ||
# Install git | ||
sudo apt-get install git -y | ||
fi | ||
|
||
# Specify the remote repository URL | ||
remote_repo="https://github.com/wickedyoda/public-setupfiles.git" | ||
|
||
# Specify the local file path | ||
local_file="/home/traver/pubic-setupfiles" | ||
local_file="./pubic-setupfiles" | ||
|
||
# Check if the local file path exists and is not empty | ||
if [ -d "$local_file" ] && [ -n "$(ls -A $local_file)" ]; then | ||
# Delete the existing directory | ||
rm -rf "$local_file" | ||
sudo rm -rf "$local_file" | ||
fi | ||
|
||
# Clone the remote repository to the local file path | ||
git clone "$remote_repo" "$local_file" | ||
|
||
cd /home/traver | ||
chmod +x ./public-setupfiles/*.sh | ||
# Make all files executable and public ownership | ||
sudo chmod 777 -R $local_file | ||
|