diff options
| author | 2019-03-17 18:39:21 +0530 | |
|---|---|---|
| committer | 2019-03-17 18:40:54 +0530 | |
| commit | e1bd7c68524e8fac8279863d8b5f3b249f22942d (patch) | |
| tree | 49698d55bd2930b706e1bfdc26f893f6f2cfc0f1 /user-scripts/upgrade | |
| parent | ff0378c18b73009b5293c34e4e709054b69e7cd7 (diff) | |
| download | nnn-e1bd7c68524e8fac8279863d8b5f3b249f22942d.tar.gz | |
Drop the .sh subscripts
Diffstat (limited to 'user-scripts/upgrade')
| -rwxr-xr-x | user-scripts/upgrade | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/user-scripts/upgrade b/user-scripts/upgrade new file mode 100755 index 0000000..fa044ee --- /dev/null +++ b/user-scripts/upgrade @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Description: Check and update to latest version of nnn manually on Debian 9 Stretch +# +# Shell: bash +# Author: Arun Prakash Jana +# NOTE: This script installs a package, should be issued with admin privilege + +cur=`nnn -v` +new=`curl -s "https://github.com/jarun/nnn/releases/latest" | grep -Eo "[0-9]+\.[0-9]+"` + +if [ $cur_ver == $new_ver ]; then + echo 'Already at latest version' + exit 0 +fi + +# get the package +wget "https://github.com/jarun/nnn/releases/download/v$new/nnn_$new-1_debian9.amd64.deb" + +# install it +dpkg -i nnn_$new-1_debian9.amd64.deb + +# remove the file +rm -rf nnn_$new-1_debian9.amd64.deb |