Skip to content

Commit

Permalink
lmao
Browse files Browse the repository at this point in the history
  • Loading branch information
mesaprotector committed Dec 16, 2024
1 parent 8248b00 commit a49cd15
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions addcomment
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,6 @@ tty="`tty | cut -d '/' -f 3-`"
mytmpdir="`cat "$tmpdir/$tty"`"
echo "Comment on an edit? [y/yp/N] "
read -r comment
if [ "$comment" = "N" ]; then
echo "N/A" > "$tmpdir"/"$tty"
echo "No comment added"
elif [ "$comment" = "yp" ]; then
echo -e "=POSTDATED=" >> "$mytmpdir"/comment.tmp
lines="`cat "$mytmpdir"/comment.tmp | wc -l`"
sed '1s/^/@@ /' "$mytmpdir"/comment.tmp > "$mytmpdir"/head.tmp
eval "$editor" "$mytmpdir"/comment.tmp
tail -n +$((lines+1)) "$mytmpdir"/comment.tmp \
| fold -s | sed 's/^/# /' > "$mytmpdir"/tail.tmp
cat "$mytmpdir"/head.tmp "$mytmpdir"/tail.tmp > "$mytmpdir"/comment.tmp
echo "OK" > "$tmpdir"/"$tty"
echo "Comment added"
else
lines="`cat "$mytmpdir"/comment.tmp | wc -l`"
sed -i '1s/^/@@ /' "$mytmpdir"/comment.tmp
sed '1s/^/@@ /' "$mytmpdir"/comment.tmp > "$mytmpdir"/head.tmp
eval "$editor" "$mytmpdir"/comment.tmp
tail -n +$((lines+1)) "$mytmpdir"/comment.tmp \
| fold -s | sed 's/^/# /' > "$mytmpdir"/tail.tmp
cat "$mytmpdir"/head.tmp "$mytmpdir"/tail.tmp > "$mytmpdir"/comment.tmp
echo "OK" > "$tmpdir"/"$tty"
echo "Comment added"
fi
#!/bin/bash
if [ "`ps ax | awk '$5 ~ /\/bin\/bash/' | awk '$6 ~ \
/\/lib\/waitcomment.sh/' | wc -l`" = "0" ]; then
echo "No waitcomment process"
exit
fi
. /etc/sudo-comment.conf
tty="`tty | cut -d '/' -f 3-`"
mytmpdir="`cat "$tmpdir/$tty"`"
echo "Comment on an edit? [y/yp/N] "
read -r comment
if [ "$comment" = "N" ]; then
echo "N/A" > "$tmpdir"/"$tty"
echo "No comment added"
Expand Down

0 comments on commit a49cd15

Please # to comment.