Skip to content

Commit

Permalink
add abs.abs-update script
Browse files Browse the repository at this point in the history
  • Loading branch information
SepehrSoheily authored and sepsoh committed Jul 27, 2024
1 parent db6f631 commit f238595
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ You can also use each script individually.
| [abs.move-and-link](<Scripts/Move And Link>) | Move files and link to new path (old path also work) |
| [abs.share-file](<Scripts/Share File>) | Upload Files on the http://0x0.st and get download link |
| [abs.package-files](<Scripts/Package Files>) | Get the files of a package and their size |
| [abs.abs-uninstall](<Scripts/ABS Uninstall>) | Uninstall Me |
| [abs.abs-update](<Scripts/ABS Update>) | Update me to latest version |
| [abs.abs-uninstall](<Scripts/ABS Uninstall>) | Uninstall me and delete all sctipts |
7 changes: 7 additions & 0 deletions Scripts/ABS Update/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Update abs scripts

## Usage
```
chmod +x abs-update.sh
./abs-update.sh
```
29 changes: 29 additions & 0 deletions Scripts/ABS Update/abs-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
repo="sepsoh/awesome-bash-scripts"

# Check for required tools
command -v curl >/dev/null 2>&1 || { echo >&2 "curl is required but it's not installed. Aborting."; exit 1; }
command -v unzip >/dev/null 2>&1 || { echo >&2 "unzip is required but it's not installed. Aborting."; exit 1; }

function download_latest_release() {
# download the latest zip file of repo in the /tmp then extract it.
url="https://github.com/$repo/archive/refs/heads/main.zip"
curl -L $url -o /tmp/awesome-bash-scripts.zip 1>/dev/null 2> /dev/null
unzip /tmp/awesome-bash-scripts.zip -d /tmp 1>/dev/null 2> /dev/null

}

function update_tools(){
bash /tmp/awesome-bash-scripts-main/install.sh
rm /tmp/awesome-bash-scripts.zip
rm -rf /tmp/awesome-bash-scripts-main
}

echo "Latest release for $repo: $latest_release"
echo "Downloading and processing the latest release..."
download_latest_release
echo "Updating ..."
update_tools
echo ""
echo "Updated Successfuly"

0 comments on commit f238595

Please sign in to comment.