Prevent stderr that DRAFT_FILE could not be found.

DRAFT_DIR is also used in the main loop so this prevent logging to sterr
ls: cannot access '/home/foobar/.config/sxmo/modem/draft': No such file or directory

Signed-off-by: Reed Wade <reedwade@misterbanal.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
master
Reed Wade 4 years ago committed by Maarten van Gompel
parent 0ae9825752
commit f539e45459
  1. 2
      scripts/modem/sxmo_modemtext.sh

@ -82,7 +82,6 @@ sendtextmenu() {
draft() {
NUMBER="$1"
TEXT="$2"
mkdir -p "$DRAFT_DIR"
DRAFT_FILE="$NUMBER-$(date +'%Y-%m-%d_%H-%m-%S')"
echo "$NUMBER" > "$DRAFT_DIR/$DRAFT_FILE"
echo "$TEXT" >> "$DRAFT_DIR/$DRAFT_FILE"
@ -111,6 +110,7 @@ tailtextlog() {
}
main() {
[ ! -d "$DRAFT_DIR" ] && mkdir -p "$DRAFT_DIR"
# E.g. only display logfiles for directories that exist and join w contact name
ENTRIES="$(
printf %b "Close Menu\nSend a Text$( [ "$(ls -A "$DRAFT_DIR")" ] && printf %b "\nSend a Draft Text")\n";

Loading…
Cancel
Save