Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UCC
uccportal
Commits
b9f345c5
Commit
b9f345c5
authored
Feb 26, 2019
by
Felix von Perger
Committed by
root
Feb 26, 2019
Browse files
add dispense paid checking script
parent
08abffcf
Changes
1
Show whitespace changes
Inline
Side-by-side
src/memberdb/has_paid_dispense.sh
0 → 100755
View file @
b9f345c5
#!/bin/bash
# script to check if a user has already paid via dispense (or purchased an item in dispense)
# usage: $0 "$USERNAME" "$DISPENSE_ITEM_ID"
# prints either a date like "Feb 25 17:25:23" or "None"
LOG
=
/home/other/coke/cokelog
USER
=
$1
ITEM
=
$2
PURCHASE
=
$(
grep
"for
$USER
"
$LOG
|
grep
": dispense '"
|
grep
"
$ITEM
"
)
if
[
"x
$PURCHASE
"
==
"x"
]
||
[
$(
echo
$PURCHASE
|
wc
-l
)
-gt
1
]
;
then
echo
None
exit
1
fi
echo
$PURCHASE
|
cut
-c1-15
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment