From 07668decb30a788907c086db8e9ed53417915f06 Mon Sep 17 00:00:00 2001 From: Christian Flamm Date: Thu, 22 Feb 2018 13:43:15 +0100 Subject: [PATCH] restructuring for reusability --- afpre | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/afpre b/afpre index 831962c..6a4c2c0 100755 --- a/afpre +++ b/afpre @@ -193,13 +193,15 @@ renew() { SECONDS=0 } -PROMPT_COMMAND="{ - ((\\\$SECONDS >= \\\$(token_renew_interval) )) && { +condrenew() { + ((\$SECONDS >= \$(token_renew_interval) )) && { echo token expired - need to renew... renew echo done. } -}" +} + +PROMPT_COMMAND=condrenew PS1="AFP|${PATTERN} \$PS1"