Skip to content

Commit

Permalink
Run shellfmt on new scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pedropombeiro committed Sep 22, 2024
1 parent 3bcdcba commit 4e04b26
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
15 changes: 9 additions & 6 deletions script/scantoemail-0.2.4-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
# $2 = friendly name

{
echo "scantoemail.sh triggered"
#override environment, as brscan is screwing it up:
export $(grep -v '^#' /opt/brother/scanner/env.txt | xargs)
echo "scantoemail.sh triggered"
#override environment, as brscan is screwing it up:
export $(grep -v '^#' /opt/brother/scanner/env.txt | xargs)

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
/bin/bash $SCRIPTPATH/scanRear.sh $@
SCRIPTPATH="$(
cd "$(dirname "$0")" || exit
pwd -P
)"
/bin/bash "$SCRIPTPATH"/scanRear.sh $@

} >> /var/log/scanner.log 2>&1
} >>/var/log/scanner.log 2>&1
12 changes: 6 additions & 6 deletions script/scantoimage-0.2.4-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

{

echo "ERROR!"
echo "This function is not implemented."
echo "You may implement your own script and mount under $0."
echo "Check out scripts in same folder or https://github.com/PhilippMundhenk/BrotherScannerDocker for examples."
} >> /var/log/scanner.log 2>&1
echo "ERROR!"
echo "This function is not implemented."
echo "You may implement your own script and mount under $0."
echo "Check out scripts in same folder or https://github.com/PhilippMundhenk/BrotherScannerDocker for examples."

} >>/var/log/scanner.log 2>&1
10 changes: 5 additions & 5 deletions script/scantoocr-0.2.4-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

{

echo "ERROR!"
echo "This function is not implemented."
echo "You may implement your own script and mount under $0."
echo "Check out scripts in same folder or https://github.com/PhilippMundhenk/BrotherScannerDocker for examples."
echo "ERROR!"
echo "This function is not implemented."
echo "You may implement your own script and mount under $0."
echo "Check out scripts in same folder or https://github.com/PhilippMundhenk/BrotherScannerDocker for examples."

} >> /var/log/scanner.log 2>&1
} >>/var/log/scanner.log 2>&1
3 changes: 1 addition & 2 deletions script/trigger_inotify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ file=$5
if [ -z "${user}" ] || [ -z "${password}" ] || [ -z "${address}" ] || [ -z "${filepath}" ]; then
echo "SSH environment variables not set, skipping inotify trigger."
else
if sshpass -p "$password" ssh -o StrictHostKeyChecking=no $user@$address "sed \"\" -i $filepath/$file"; then
if sshpass -p "$password" ssh -o StrictHostKeyChecking=no "$user"@"$address" "sed \"\" -i $filepath/$file"; then
echo "trigger inotify successful"
else
echo "trigger inotify failed"
exit 1
fi
fi

2 changes: 1 addition & 1 deletion script/trigger_telegram.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ MESSAGE="Scanner: $1"
ENCODED_MESSAGE=$(echo "$MESSAGE" | jq -sRr @uri)

# Send the message using wget
wget -qO- --post-data="chat_id=$CHAT_ID&text=$ENCODED_MESSAGE" "https://api.telegram.org/$TOKEN/sendMessage" > /dev/null
wget -qO- --post-data="chat_id=$CHAT_ID&text=$ENCODED_MESSAGE" "https://api.telegram.org/$TOKEN/sendMessage" >/dev/null

0 comments on commit 4e04b26

Please sign in to comment.