Skip to content

Commit

Permalink
Modified the script to work better
Browse files Browse the repository at this point in the history
Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
  • Loading branch information
unixbhaskar committed Nov 15, 2019
1 parent 72cd034 commit 394ad87
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions get_latest_firefox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#===============================================================================

set -o nounset # Treat unset variables as an error
source /home/bhaskar/colors.sh
source $HOME/colors.sh
NOCOLOR="\033[0m"

printf "\n\n\n ${Reverse}${Bright}${LimeYellow} Get the latest firefox from Mozilla ${NOCOLOR} ....\n\n\n"
Expand All @@ -32,7 +32,7 @@ if [[ $? == 0 ]];then
fi

current_date=$(date '+%F')
folder_date=$(stat firefox | grep Birth | gawk '{ print $2 }')
folder_date=$(ls -ld --full-time $HOME/firefox | gawk '{ print $6 }')

if [[ "$folder_date" -ne "$current_date" ]];then
mv -v $HOME/firefox $HOME/firefox.$(date +"%d-%m-%Y")
Expand All @@ -41,8 +41,8 @@ fi
tar -xjf firefox.tar.bz2

cd firefox
# $HOME/firefox/firefox firefox_$version
cp -v $HOME/firefox/firefox $HOME/bin/firefox
$HOME/firefox/firefox firefox_$version
cp $HOME/firefox/firefox $HOME/bin/firefox

printf "${Bright}${Magenta} Kill the existing process.... ${NOCOLOR}...\n\n"

Expand All @@ -61,9 +61,9 @@ rm -f firefox.tar.bz2
# read old_binary
# rm -f $old_binary

printf "\n\n Put the old directory too for removal : %s "
read old_dir
rm -rf $old_dir
# printf "\n\n Put the old directory too for removal : %s "
# read old_dir
# rm -rf $old_dir

#start up

Expand Down

0 comments on commit 394ad87

Please sign in to comment.