Hell's Traffic Accident
git-svn-id: file:///srv/svn/repo/rin/trunk@4 5f6c6692-7da8-c640-9b4f-fb22b0af4e5b
This commit is contained in:
parent
20c49a1dbf
commit
1e25a0dba0
22
Makefile
22
Makefile
@ -1,12 +1,18 @@
|
|||||||
PREFIX ?= /usr/local
|
include config.mk
|
||||||
|
|
||||||
fmt:
|
|
||||||
shfmt -p -w rin
|
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f rin
|
||||||
|
distclean: clean
|
||||||
|
rm -f config.mk
|
||||||
install:
|
install:
|
||||||
install -Dm0755 rin ${PREFIX}/bin/rin
|
install -m0755 rin ${DESTDIR}${PREFIX}/bin/rin
|
||||||
install -Dm0600 rin.1 ${PREFIX}/share/man/man1/rin.1
|
install -d ${DESTDIR}${PREFIX}/lib/orin
|
||||||
|
for i in check clean fetch list profile; do
|
||||||
|
install -m0755 rin-$$i ${DESTDIR}${PREFIX}/lib/orin/rin-$$i
|
||||||
|
done
|
||||||
|
install -m0644 rin.1 ${DESTDIR}${PREFIX}/man/man1/rin.1
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f ${PREFIX}/bin/rin
|
rm -f ${DESTDIR}${PREFIX}/bin/rin
|
||||||
rm -f ${PREFIX}/man/man1/rin.1
|
rm -f ${DESTDIR}${PREFIX}/man/man1/rin.1
|
||||||
|
rm -rf ${DESTDIR}${PREFIX}/lib/orin
|
||||||
|
|
||||||
|
14
README
14
README
@ -1,10 +1,10 @@
|
|||||||
RIN(1) FreeBSD General Commands Manual RIN(1)
|
RIN(1) General Commands Manual RIN(1)
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
rin – My personal e-mail assistant, named after Rin Kaenbyou (aka Orin)
|
rin – My personal e-mail assistant, named after Rin Kaenbyou (aka Orin)
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
rin [check] [clean] [fetch] [list] account
|
rin [check] [clean] [fetch] [list] [profile] account
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
It is a script that uses fdm(1) and mblaze(7) adapted to my configuration
|
It is a script that uses fdm(1) and mblaze(7) adapted to my configuration
|
||||||
@ -22,8 +22,14 @@ USAGE
|
|||||||
list account
|
list account
|
||||||
List messages on a Maildir
|
List messages on a Maildir
|
||||||
|
|
||||||
|
profile --list
|
||||||
|
List available mblaze profiles
|
||||||
|
|
||||||
|
profile --use account
|
||||||
|
Use the specified profile
|
||||||
|
|
||||||
AUTHORS
|
AUTHORS
|
||||||
Izuru Yakumo <yakumo.izuru@chaotic.ninja>
|
Izuru Yakumo <eternal-servant@yakumo.dev>
|
||||||
|
|
||||||
FreeBSD 13.3-RELEASE July 25, 2024 FreeBSD 13.3-RELEASE
|
NetBSD 10.1 April 21, 2025 NetBSD 10.1
|
||||||
|
|
||||||
|
80
configure
vendored
Executable file
80
configure
vendored
Executable file
@ -0,0 +1,80 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# $YakumoLabs$
|
||||||
|
|
||||||
|
name="rin"
|
||||||
|
rev=`svn info --show-item revision`
|
||||||
|
|
||||||
|
prefix="/usr/local"
|
||||||
|
eprefix="${prefix}"
|
||||||
|
mandir="${prefix}/man"
|
||||||
|
|
||||||
|
check_prog() {
|
||||||
|
command -v "$@" || echo "not found" ; exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
print_usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: configure [options]
|
||||||
|
Options: [defaults in brackets after description]
|
||||||
|
|
||||||
|
Standard options:
|
||||||
|
--help print this message
|
||||||
|
--prefix=PREFIX install in PREFIX [/usr/local]
|
||||||
|
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as PREFIX]
|
||||||
|
|
||||||
|
--mandir=DIR man documentation in DIR [PREFIX/man]
|
||||||
|
|
||||||
|
"If I kill you, human, my hellfire cart will get heavy~♪ Man, carrying off corpses is fun!"
|
||||||
|
~Rin Kaenbyou to Reimu Hakurei (Subterranean Animism Stage 5.)
|
||||||
|
|
||||||
|
Package name: $name
|
||||||
|
Revision: $rev
|
||||||
|
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
for arg; do
|
||||||
|
case "$arg" in
|
||||||
|
--prefix=*)
|
||||||
|
prefix=`echo $arg | cut -d '=' -f2`
|
||||||
|
;;
|
||||||
|
--exec-prefix=*)
|
||||||
|
eprefix=${prefix}
|
||||||
|
;;
|
||||||
|
--mandir=*)
|
||||||
|
mandir=`echo $arg | cut -d '=' -f2`
|
||||||
|
;;
|
||||||
|
-h|--help)
|
||||||
|
print_usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$0: WARNING: unrecognized option $arg"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
printf "Checking for fdm... %s\n" `check_prog fdm`
|
||||||
|
printf "Checking for find... %s\n" `check_prog find`
|
||||||
|
printf "Checking for minc... %s\n" `check_prog minc`
|
||||||
|
printf "Checking for mlist... %s\n" `check_prog mlist`
|
||||||
|
printf "Checking for mscan... %s\n" `check_prog mscan`
|
||||||
|
printf "Checking for mseq... %s\n" `check_prog mseq`
|
||||||
|
printf "Checking for msort... %s\n" `check_prog msort`
|
||||||
|
printf "Checking for mthread... %s\n" `check_prog mthread`
|
||||||
|
printf "Checking for rm... %s\n" `check_prog rm`
|
||||||
|
printf "Checking for xargs... %s\n" `check_prog xargs`
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
==========
|
||||||
|
Installation prefix: ${prefix}
|
||||||
|
Manual pages directory: ${mandir}
|
||||||
|
==========
|
||||||
|
|
||||||
|
$0: Creating rin....
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sed "s#%%PREFIX%%#${prefix}#g" rin.in > rin
|
||||||
|
echo "PREFIX=${prefix}" > config.mk
|
||||||
|
echo "MANDIR=${mandir}" >> config.mk
|
61
rin
61
rin
@ -1,61 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# $TheSupernovaDuo$
|
|
||||||
# (o)rin - my personal e-mail assistant in posix shell
|
|
||||||
|
|
||||||
# Source code:
|
|
||||||
# - https://gitler.moe/novaburst/orin
|
|
||||||
# - https://git.chaotic.ninja/yakumo.izuru/orin
|
|
||||||
|
|
||||||
# Check for mail in the server
|
|
||||||
# Arguments: <account>
|
|
||||||
fn_check() {
|
|
||||||
fdm -a "$@" poll 2>/dev/null
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "ごめんなさい、できませんでした..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Clean-up the Maildir directory
|
|
||||||
# Arguments: <account>
|
|
||||||
fn_clean() {
|
|
||||||
find "$@"/cur -type f -print -delete
|
|
||||||
}
|
|
||||||
# Fetch e-mails from remote server
|
|
||||||
# Arguments: <account>
|
|
||||||
fn_fetch() {
|
|
||||||
echo "はい、すぐに!"
|
|
||||||
fdm -a "$@" fetch 2>/dev/null
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "ごめんなさい、できませんでした..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
# List messages on a Maildir
|
|
||||||
# Arguments: <account>
|
|
||||||
fn_list() {
|
|
||||||
minc -q "$HOME/Mail/$@/INBOX"
|
|
||||||
mlist -s "$HOME/Mail/$@/INBOX" | msort -dr | mthread -r | mseq -S | mscan
|
|
||||||
}
|
|
||||||
# Print an usage note
|
|
||||||
# Triggered if the assistant is called without any arguments.
|
|
||||||
fn_usage() {
|
|
||||||
printf "usage: %s [ check | clean | fetch | list ] <account/message> \n" "$(basename $0)"
|
|
||||||
}
|
|
||||||
case $1 in
|
|
||||||
check)
|
|
||||||
fn_check "$2"
|
|
||||||
;;
|
|
||||||
clean)
|
|
||||||
fn_clean "$2"
|
|
||||||
;;
|
|
||||||
fetch)
|
|
||||||
fn_fetch "$2"
|
|
||||||
;;
|
|
||||||
list)
|
|
||||||
fn_list "$2"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
fn_usage
|
|
||||||
;;
|
|
||||||
esac
|
|
8
rin-check
Normal file
8
rin-check
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# $YakumoLabs$
|
||||||
|
echo "Checking if there is any mail..."
|
||||||
|
env fdm -a "$@" poll
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Sorry, I couldn't..."
|
||||||
|
exit 1
|
||||||
|
fi
|
23
rin-clean
Normal file
23
rin-clean
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# $YakumoLabs$
|
||||||
|
# XXX: This command is destructive
|
||||||
|
|
||||||
|
if [ "$1" = "" ]; then
|
||||||
|
echo "No account specified"
|
||||||
|
echo ""
|
||||||
|
echo "usage: $0 account"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Do you really want to remove all mail for account: $1? [y/n]"
|
||||||
|
read answer
|
||||||
|
case $answer in
|
||||||
|
[y|Y])
|
||||||
|
echo "You asked for it!"
|
||||||
|
find "${HOME}/Mail/$1/cur" -type f -0 | xargs rm -f -v
|
||||||
|
;;
|
||||||
|
[n|N])
|
||||||
|
echo "Aborting operation"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
8
rin-fetch
Normal file
8
rin-fetch
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# $YakumoLabs$
|
||||||
|
echo "Fetching mail from account: $1 ..."
|
||||||
|
env fdm -a "$@" fetch
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Sorry, I couldn't..."
|
||||||
|
exit 1
|
||||||
|
fi
|
4
rin-list
Normal file
4
rin-list
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# $YakumoLabs$
|
||||||
|
env minc -q "$HOME/Mail/$1/INBOX"
|
||||||
|
env mlist -s "$HOME/Mail/$1/INBOX" | env msort -dr | env mthread -r | env mseq -S | env mscan
|
19
rin-profile
Executable file
19
rin-profile
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# $YakumoLabs$
|
||||||
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
echo "usage: $0 [-l] [-u profile-name]"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
-l|--list)
|
||||||
|
echo "List of available profiles"
|
||||||
|
find "${HOME}/.mblaze" -name "profile-*" -type f
|
||||||
|
;;
|
||||||
|
-u|--use)
|
||||||
|
echo "Using profile $2"
|
||||||
|
ln -sf "${HOME}/.mblaze/profile-$2" "${HOME}/.mblaze/profile"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unrecognized switch $1"
|
||||||
|
;;
|
||||||
|
esac
|
9
rin.1
9
rin.1
@ -1,4 +1,4 @@
|
|||||||
.Dd July 25, 2024
|
.Dd April 21, 2025
|
||||||
.Dt RIN 1
|
.Dt RIN 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -10,6 +10,7 @@
|
|||||||
.Op clean
|
.Op clean
|
||||||
.Op fetch
|
.Op fetch
|
||||||
.Op list
|
.Op list
|
||||||
|
.Op profile
|
||||||
.Ar account
|
.Ar account
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
It is a script that uses
|
It is a script that uses
|
||||||
@ -27,6 +28,10 @@ Clean up the Maildir directory
|
|||||||
Fetch mail from the remote server
|
Fetch mail from the remote server
|
||||||
.It list Ar account
|
.It list Ar account
|
||||||
List messages on a Maildir
|
List messages on a Maildir
|
||||||
|
.It profile Cm --list
|
||||||
|
List available mblaze profiles
|
||||||
|
.It profile Cm --use account
|
||||||
|
Use the specified profile
|
||||||
.El
|
.El
|
||||||
.Sh AUTHORS
|
.Sh AUTHORS
|
||||||
.An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja
|
.An Izuru Yakumo Aq Mt eternal-servant@yakumo.dev
|
||||||
|
32
rin.in
Normal file
32
rin.in
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# $YakumoLabs$
|
||||||
|
# (o)rin -- My personal e-mail assistant from the former Hell of Blazing Fires
|
||||||
|
#
|
||||||
|
# Source code:
|
||||||
|
# - https://svn.yakumo.dev/repo/rin (primary)
|
||||||
|
# - https://git.yakumo.dev/yakumo.izuru/rin (mirror)
|
||||||
|
case "$1" in
|
||||||
|
check)
|
||||||
|
%%PREFIX%%/lib/orin/rin-check "$2"
|
||||||
|
;;
|
||||||
|
clean)
|
||||||
|
%%PREFIX%%/lib/orin/rin-clean "$2"
|
||||||
|
;;
|
||||||
|
fetch)
|
||||||
|
%%PREFIX%%/lib/orin/rin-fetch "$2"
|
||||||
|
;;
|
||||||
|
list)
|
||||||
|
%%PREFIX%%/lib/orin/rin-list "$2"
|
||||||
|
;;
|
||||||
|
profile)
|
||||||
|
%%PREFIX%%/lib/orin/rin-profile "$2" "$3"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
cat <<EOF
|
||||||
|
usage: $0 [check|clean|fetch|list|profile] account
|
||||||
|
note: some subcommands have additional options
|
||||||
|
EOF
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user