From b58ca3744cbe6ae098fb5b70ad047687dafeba6c Mon Sep 17 00:00:00 2001 From: ShirinLabay Date: Sat, 5 Aug 2023 05:52:49 +0300 Subject: [PATCH 1/3] initial commit --- bash_project/.bash_profile | 39 +++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/bash_project/.bash_profile b/bash_project/.bash_profile index 1bd30a1..403ef31 100755 --- a/bash_project/.bash_profile +++ b/bash_project/.bash_profile @@ -1 +1,38 @@ -# your solution here... \ No newline at end of file +#!/bin/bash +echo "Hello $USER" +export COURSE_ID=DevOpsBootcampElevation + +cd $HOME + +if [[ $(stat -c '%a' ~/.token) != "600" ]] +then + echo "Warning: .token file has too open permissions" + +fi + +# 666-006=660 -> 110 110 000 +umask=006 + +export PATH=$PATH:/home/$USER/usercommands + +# UTC=-u , iso8601=-I or --iso-8601=seconds +# 2023-07-31T20:41:50+00:00 +date -u --iso-8601=seconds + +# all files with .txt extension -> ls *.txt +alias ltxt='ls *.txt' + +cd $HOME +if [ -d ~/tmp ] +then + rm -rf ~/tmp/* +else + mkdir ~/tmp +fi + +PROCESS_ID=$(lsof -t -i :8080) +if [ $PROCESS_ID ] +then + kill -9 $PROCESS_ID + echo "killed process" +fi From 947a7a55d672d0c0f9227787380e63c04ed23596 Mon Sep 17 00:00:00 2001 From: ShirinLabay Date: Mon, 14 Aug 2023 08:25:13 +0300 Subject: [PATCH 2/3] fixed token --- bash_project/.bash_profile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bash_project/.bash_profile b/bash_project/.bash_profile index 403ef31..a4d0712 100755 --- a/bash_project/.bash_profile +++ b/bash_project/.bash_profile @@ -2,16 +2,16 @@ echo "Hello $USER" export COURSE_ID=DevOpsBootcampElevation -cd $HOME - -if [[ $(stat -c '%a' ~/.token) != "600" ]] +if [ -f ~/.token ] then - echo "Warning: .token file has too open permissions" - + if [[ $(stat -c '%a' ~/.token) != "600" ]] + then + echo "Warning: .token file has too open permissions" + fi fi # 666-006=660 -> 110 110 000 -umask=006 +umask=0006 export PATH=$PATH:/home/$USER/usercommands @@ -22,7 +22,6 @@ date -u --iso-8601=seconds # all files with .txt extension -> ls *.txt alias ltxt='ls *.txt' -cd $HOME if [ -d ~/tmp ] then rm -rf ~/tmp/* From 875605e181747e86a38335ebfcde9068f28823c8 Mon Sep 17 00:00:00 2001 From: ShirinLabay Date: Mon, 14 Aug 2023 12:10:57 +0300 Subject: [PATCH 3/3] fixed umask --- bash_project/.bash_profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_project/.bash_profile b/bash_project/.bash_profile index a4d0712..97f43cd 100755 --- a/bash_project/.bash_profile +++ b/bash_project/.bash_profile @@ -11,7 +11,7 @@ then fi # 666-006=660 -> 110 110 000 -umask=0006 +umask 0006 export PATH=$PATH:/home/$USER/usercommands