aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-11-11 00:14:37 +0700
committerShulhan <ms@kilabit.info>2024-11-11 00:21:59 +0700
commitbc89bb8018ebd93f1327ca48a49369b93d37b5f8 (patch)
treeebb9ebff07d3dc14464af941db8be08e52bda30c
parent8852c6b37fe14e3cf723704f6e28dc88621b51b6 (diff)
downloadbin.sh-bc89bb8018ebd93f1327ca48a49369b93d37b5f8.tar.xz
bin: add script "gen-password.sh"
The gen-password.sh is shell script to generate random words from Indonesian directory of hunspell. The hunspell-id package can be installed from AUR: https://aur.archlinux.org/packages/hunspell-id-git
-rw-r--r--AUR/.SRCINFO5
-rw-r--r--AUR/PKGBUILD10
-rwxr-xr-xbin/gen-password.sh19
3 files changed, 28 insertions, 6 deletions
diff --git a/AUR/.SRCINFO b/AUR/.SRCINFO
index 221058d..0bfeffe 100644
--- a/AUR/.SRCINFO
+++ b/AUR/.SRCINFO
@@ -1,11 +1,14 @@
pkgbase = bin.sh-git
pkgdesc = A collection of shell scripts
- pkgver = r5.4f502f0
+ pkgver = r12.9b615c3
pkgrel = 1
url = https://git.sr.ht/~shulhan/bin.sh
arch = any
license = GPL3
makedepends = git
+ makedepends = pkgconf
+ depends = bash-completion
+ depends = hunspell-id-git
provides = bin.sh
conflicts = bin.sh
source = bin.sh::git+https://git.sr.ht/~shulhan/bin.sh
diff --git a/AUR/PKGBUILD b/AUR/PKGBUILD
index 1b8b010..421c7e0 100644
--- a/AUR/PKGBUILD
+++ b/AUR/PKGBUILD
@@ -1,16 +1,16 @@
# Maintainer: Shulhan <ms@kilabit.info>
pkgname=bin.sh-git
-pkgver=r5.4f502f0
+pkgver=r12.80334be
pkgrel=1
pkgdesc='A collection of shell scripts'
arch=('any')
url='https://git.sr.ht/~shulhan/bin.sh'
license=('GPL3')
groups=()
-depends=()
-makedepends=('git')
-provides=("${pkgname%-git}")
-conflicts=("${pkgname%-git}")
+depends=('bash-completion' 'hunspell-id-git')
+makedepends=('git' 'pkgconf')
+provides=('bin.sh')
+conflicts=('bin.sh')
replaces=()
backup=()
options=()
diff --git a/bin/gen-password.sh b/bin/gen-password.sh
new file mode 100755
index 0000000..52c35e5
--- /dev/null
+++ b/bin/gen-password.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+## SPDX-FileCopyrightText: 2022 M. Shulhan <ms@kilabit.info>
+## SPDX-License-Identifier: GPL-3.0-or-later
+
+## Script to generate random words from Indonesian directory of hunspell.
+
+DIC=/usr/share/hunspell/id_ID.dic
+KATA=(`cat ${DIC} | tail -n+13 | cut -d'/' -f1`)
+
+MAX=${#KATA[@]}
+RANDOM=$$
+export PASS=
+
+for x in 1 2 3 4; do
+ n=$((${RANDOM} % ${MAX}))
+ PASS="${PASS}${x}${KATA[n]}"
+done
+
+echo "Generated password is $PASS"