mirror of
https://github.com/wickedyoda/public-setupfiles.git
synced 2026-11-16 13:31:56 -06:00
Last update
This commit is contained in:
1 parent
9d273956c2
commit
d8f89c99fe
1 file changed
+14
-4
+14
-4
@@ -1,19 +1,29 @@
|
|||||||
#!/bin/bash
|
#!/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
|
# Specify the remote repository URL
|
||||||
remote_repo="https://github.com/wickedyoda/public-setupfiles.git"
|
remote_repo="https://github.com/wickedyoda/public-setupfiles.git"
|
||||||
|
|
||||||
# Specify the local file path
|
# 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
|
# Check if the local file path exists and is not empty
|
||||||
if [ -d "$local_file" ] && [ -n "$(ls -A $local_file)" ]; then
|
if [ -d "$local_file" ] && [ -n "$(ls -A $local_file)" ]; then
|
||||||
# Delete the existing directory
|
# Delete the existing directory
|
||||||
rm -rf "$local_file"
|
sudo rm -rf "$local_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clone the remote repository to the local file path
|
# Clone the remote repository to the local file path
|
||||||
git clone "$remote_repo" "$local_file"
|
git clone "$remote_repo" "$local_file"
|
||||||
|
|
||||||
cd /home/traver
|
# Make all files executable and public ownership
|
||||||
chmod +x ./public-setupfiles/*.sh
|
sudo chmod 777 -R $local_file
|
||||||
|
|
||||||
Reference in new issue
Block a user