Legend:
- Unmodified
- Added
- Removed
-
trunk/README.md
r24 r29 11 11 * [dd(1)](https://man.netbsd.org/dd.1) 12 12 * [oathtool(1)](https://www.nongnu.org/oath-toolkit/) 13 * [openssl(1)](https://www.openssl.org) 13 14 * [rm(1)](https://man.netbsd.org/rm.1) 14 * [strings(1)](https://man.netbsd.org/strings.1)15 * [tr(1)](https://man.netbsd.org/tr.1)16 15 * [tree(1)](https://github.com/Old-Man-Programmer/tree) 17 16 -
trunk/kanako
r28 r29 1 1 #!/bin/sh 2 # $YakumoLabs: kanako,v 2. 3 2025/05/14 02:07:06 yakumo_izuru Exp $2 # $YakumoLabs: kanako,v 2.4 2025/05/18 14:59:46 yakumo_izuru Exp $ 3 3 4 4 kanako_conf_dir="${kanako_conf_dir:-$HOME/.config/kanako}" … … 23 23 view "$1" | "${kanako_clip_cmd}" 24 24 } 25 delf() { 26 _warn "Will be removing $1" 27 _warn "Are you okay with that?" 28 read junk 29 case ${junk} in 30 n | N) _info "Abort" ;; 31 y | Y) [ test -d "${1}" ] && _die "${1} is a directory, use $0 -R" || rm -f "${1}.enc" && _info "Removed $1/$2" ;; 32 esac 33 } 34 delr() { 35 _warn "Will be removing $1" 36 _warn "Are you okay with that?" 37 _warn "[y/n]" 38 read junk 39 case ${junk} in 40 n | N) _info "Abort" ;; 41 y | Y) rm -rf "${1}" && _info "Removed $1" ;; 42 esac 43 } 25 44 edit() { 26 45 if [ -f ${1%%.enc}.enc ]; then … … 34 53 } 35 54 gen() { 36 printf "%s\n" $( strings </dev/urandom | dd bs=1 count="${1:-30}" 2>/dev/null | tr -d ' \t\n\r')55 printf "%s\n" $(openssl rand -hex "${1:-30}") 37 56 } 38 57 list() { … … 64 83 fi 65 84 } 66 delete_directory() {67 _warn "Will be removing $1"68 _warn "Are you okay with that?"69 read junk70 case ${junk} in71 n | N) _info "Abort" ;;72 y | Y) rm -rf "${1}" && _info "Removed $1" ;;73 esac74 }75 delete_file() {76 _warn "Will be removing $1"77 _warn "Are you okay with that?"78 read junk79 case ${junk} in80 n | N) _info "Abort" ;;81 y | Y) rm -f "${1}.enc" && _info "Removed $1/$2" ;;82 esac83 }84 85 usage() { 85 86 _info "Usage: kanako [-ceglnorRv] args" … … 107 108 -n) new ${arg} ;; 108 109 -o) otp ${arg} ;; 109 -r) del ete_file${arg} ;;110 -R) del ete_directory${arg} ;;110 -r) delf ${arg} ;; 111 -R) delr ${arg} ;; 111 112 -v) view ${arg} ;; 112 113 *) usage ;;
Note:
See TracChangeset
for help on using the changeset viewer.