From aabe3afff88a71c295386a22315c183aba894ac9 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 2 May 2016 22:34:26 +0100 Subject: Rename stanza handler init functions --- src/xmpp/presence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xmpp/presence.c') diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index 0a9b3ce0..d817965a 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -131,7 +131,7 @@ _presence_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *co } void -presence_add_handlers(void) +presence_handlers_init(void) { xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); -- cgit 1.4.1-2-gfad0 ion> an actually boring password manager using age(1) as encryption backend. Aoi Koizumi <novaburst@kalli.st>
about summary refs log blame commit diff stats
path: root/ayu
blob: b4c1f39191205571d2c8ba6fb7b8a2507d5177f5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                                                   
                                               




              





                                                                            



                       
       


                                     







                                                          



                                     
         
                                                                



                                       
                                                                  







                                  


                       


                    







                         







                       
#!/bin/sh

# Path to the program's directory
ayu_dir="$HOME/.config/ayu"

# Path to the age(1) keys
ayu_key="$ayu_dir/age.key"
ayu_pub="$ayu_dir/age.pub"

# Path to the password store
ayu_store="$HOME/.ayu"

test -d $ayu_dir || mkdir -p $ayu_dir
test -d $ayu_store || mkdir -p $ayu_store


if ! [ -f $ayu_key ];then
	printf "First generate your own age(1) key with age-keygen(1) and place it as $ayu_key. \n"
	printf "e.g: age-keygen -o $ayu_key \n"
	exit 1
fi

cd $ayu_store

edit() {
	age --decrypt --identity=$ayu_key --output=${1%%.age} ${1%%.age}.age
	vi ${1%%.age}
	age --encrypt -R $ayu_pub --output=${1%%.age}.age ${1%%.age}
}

list() {
	tree $ayu_store
}

new() {
	test -d "$1" && usage && exit

	tmpfile="$(mktemp)"
	vi "$tmpfile"

	mkdir -p "$(dirname "$1")"
	age --encrypt -R $ayu_pub -o $tmpfile.age $tmpfile

	mv $tmpfile.age "${1%%.age}".age
	rm $tmpfile
}
remove() {
	test -d "$1" && usage && exit
	rm -r "$(dirname "$1")"
}
usage() {
	printf "$0 [ edit | list | new | rm | usage | view ] \n"
}

view() {
	if [ -f "${1%%.age}".age ];then
		age --decrypt --identity=$ayu_key "${1%%.age}".age
	elif [ -d "${1:-.}" ];then
		tree "${1:-.}"
	else
		usage
		exit
	fi
}
case $1 in
	edit)
		edit $2
		;;
	list)
		list
		;;
	new)
		new $2
		;;
	rm)
		remove $2
		;;
	usage)
		usage
		;;
	view)
		view $2
		;;
	*)
		list
		;;
esac