diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-30 15:36:05 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-30 15:36:05 +0800 |
commit | 7df5e5e9041c11c18d5bd54983a9c21a3864fadb (patch) | |
tree | 3bfeb85ed8db17e1c5ce764d1059141eab10da42 /misc/otp | |
parent | 7b03670b21e0feaaf5db6b9dec23f314b9601e13 (diff) |
Update
Diffstat (limited to 'misc/otp')
-rwxr-xr-x | misc/otp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/misc/otp b/misc/otp new file mode 100755 index 0000000..ccdc1f3 --- /dev/null +++ b/misc/otp | |||
@@ -0,0 +1,12 @@ | |||
1 | #! /usr/bin/bash | ||
2 | |||
3 | echo -n "OTP: " | ||
4 | read -r otp | ||
5 | |||
6 | if grep "^$otp$" /home/pham/.otp; then | ||
7 | TEMP=`mktemp` | ||
8 | sed "/^$otp$/ d" /home/pham/.otp >$TEMP | ||
9 | cat $TEMP > /home/pham/.otp | ||
10 | rm $TEMP | ||
11 | su pham | ||
12 | fi | ||