|
|
@ -4,6 +4,7 @@ source ~/.markrc |
|
|
|
today=$(date +%Y-%m-%d\ %H:%M:%S) |
|
|
|
file_path=$base_path/$(date +%Y-%m).txt |
|
|
|
login_message=$username $today $login_message |
|
|
|
logout_message=$username $today $logout_message |
|
|
|
|
|
|
|
# Login if it is the first message of the day |
|
|
|
if [[ -f $file_path ]]; then |
|
|
@ -15,3 +16,18 @@ if [[ -f $file_path ]]; then |
|
|
|
else |
|
|
|
echo $login_message >> $file_path |
|
|
|
fi |
|
|
|
|
|
|
|
case "$*" in |
|
|
|
"" ) |
|
|
|
echo "Include command" |
|
|
|
;; |
|
|
|
login ) |
|
|
|
exit |
|
|
|
;; |
|
|
|
logout ) |
|
|
|
echo $logout_message >> $file_path |
|
|
|
exit |
|
|
|
;; |
|
|
|
* ) |
|
|
|
message=$(echo $* | sed "s/^/$username $today /") |
|
|
|
echo $message >> $file_path |
|
|
|