From e52b35a14eb95f541c48c53cf70c53ca3aa0e57e Mon Sep 17 00:00:00 2001 From: Qrakhen Date: Thu, 2 Apr 2026 02:15:23 +0200 Subject: [PATCH] some fixes --- install.sh | 8 +++++--- library/deadline.listen.sh | 2 +- library/getdt.sh | 6 +++++- 3 files changed, 11 insertions(+), 5 deletions(-) mode change 100644 => 100755 install.sh diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index 6b981ec..36193d1 --- a/install.sh +++ b/install.sh @@ -22,12 +22,13 @@ if [[ $REPLY == 'y' ]]; then mkdir -p "$dir/hooks" cp -r ./library/* $dir cp -r ./library/hooks/* $dir/hooks/ + chmod 744 -R $dir/ echo "Backing up old .bashrc..." i=0 while [[ -f ~/.bashrc.bak.$i ]] do - i=$i + 1 + i=$((i + 1)) done; mv ~/.bashrc ~/.bashrc.bak.$i @@ -37,9 +38,10 @@ if [[ $REPLY == 'y' ]]; then echo "# Installed on $(date -u +'%02d.%02m.%Y %02H:%02M:%02S')" >> ~/.bashrc echo "" >> ~/.bashrc echo "source $QASH_LIBRARY_DIR/load.sh" >> ~/.bashrc - printf "\e[35mQash $QASH_VERSION successfully installed!\e[0m" + printf "\e[35mQash $QASH_VERSION successfully installed!\e[0m\n" + echo "USE source ~/.bashrc TO LOAD QASH IF YOU HAVE EXECUTED THIS SCRIPT IN ITS OWN SHELL." exit 1 fi echo "Installation cancelled." -exit 1 \ No newline at end of file +exit 1 diff --git a/library/deadline.listen.sh b/library/deadline.listen.sh index 982068f..6fda5db 100644 --- a/library/deadline.listen.sh +++ b/library/deadline.listen.sh @@ -1,2 +1,2 @@ #!/bin/bash -export PROMPT_COMMAND="$QASH_LIBRARY_DIR/deadline.check.sh; $PROMPT_COMMAND" \ No newline at end of file +# export PROMPT_COMMAND="$QASH_LIBRARY_DIR/deadline.check.sh; $PROMPT_COMMAND" diff --git a/library/getdt.sh b/library/getdt.sh index 61b464d..3bf8cc0 100644 --- a/library/getdt.sh +++ b/library/getdt.sh @@ -1,14 +1,17 @@ #!/bin/bash if [[ $# -lt 3 ]]; then echo "Usage: getdt (format)" - return -1 + exit 0 fi + from_date=$1 to_date=$2 format="%02d days, %02d:%02d:%02d" + if [[ $# -gt 3 ]]; then format=$3 fi + target_epoch=$(date -d "$from_date" +%s) now_epoch=$(date -d "$to_date" +%s) remaining_seconds=$((target_epoch - now_epoch)) @@ -19,3 +22,4 @@ minutes=$(((remaining_seconds % 3600) / 60)) seconds=$((remaining_seconds % 60)) printf "%02d days, %02d:%02d:%02d" $days $hours $minutes $seconds +exit 0