Align shell style all over the repo
This commit is contained in:
parent
afb13d9c9c
commit
d5e71c46f7
16 changed files with 113 additions and 86 deletions
|
@ -1,4 +1,15 @@
|
|||
#!/bin/sh
|
||||
# env
|
||||
# Written in 2020 by Lucas
|
||||
# CC0 1.0 Universal/Public domain - No rights reserved
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all
|
||||
# copyright and related and neighboring rights to this software to the
|
||||
# public domain worldwide. This software is distributed without any
|
||||
# warranty. You should have received a copy of the CC0 Public Domain
|
||||
# Dedication along with this software. If not, see
|
||||
# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
usage()
|
||||
{
|
||||
printf "Usage: %s [-c curve] [-d days] domain\n" "${0##*/}" >&2
|
||||
|
@ -28,7 +39,7 @@ shift $((OPTIND - 1))
|
|||
domain=$1
|
||||
|
||||
if [ -f "$domain.key" ]; then
|
||||
printf "%s: key for %s already exists; reusing it.\n" \
|
||||
printf "%s: key for %s already exists; reusing it\n" \
|
||||
"${0##*/}" "$domain" >&2
|
||||
else
|
||||
(umask 0377 &&
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
#!/bin/sh
|
||||
# env
|
||||
# Written in 2020 by Lucas
|
||||
# CC0 1.0 Universal/Public domain - No rights reserved
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all
|
||||
# copyright and related and neighboring rights to this software to the
|
||||
# public domain worldwide. This software is distributed without any
|
||||
# warranty. You should have received a copy of the CC0 Public Domain
|
||||
# Dedication along with this software. If not, see
|
||||
# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
usage()
|
||||
{
|
||||
printf "Usage: %s newkey\n" "${0##*/}" >&2
|
||||
|
@ -18,21 +29,21 @@ newsekrit()
|
|||
|
||||
[ $# -eq 1 ] || usage
|
||||
newkey=$1
|
||||
gpg2 -k "$newkey" >/dev/null || err "Can't find key \"$newkey\""
|
||||
gpg2 -k "$newkey" >/dev/null || err "can't find key $newkey"
|
||||
|
||||
umask 077
|
||||
newdir=$(mktemp -dt sekrit-XXXXXXXXXX) ||
|
||||
err "Failed to create temporary directory"
|
||||
err "failed to create temporary directory"
|
||||
scratch=$(mktemp -tp "$newdir" .sekrit-scratch-XXXXXXXXXX) ||
|
||||
err "Failed to create scratch file"
|
||||
err "failed to create scratch file"
|
||||
trap 'rm -fr -- "$scratch" "$newdir"' INT QUIT TERM
|
||||
|
||||
for entry in $(sekrit ls | grep -v ^DONE); do
|
||||
printf "%s... " "$entry"
|
||||
sekrit get "$entry" >|"$scratch" ||
|
||||
err "Failed to export entry \"$entry\""
|
||||
err "failed to export entry $entry"
|
||||
newsekrit add "$entry" <"$scratch" ||
|
||||
err "Failed to import entry \"$entry\""
|
||||
err "failed to import entry $entry"
|
||||
printf "OK\n"
|
||||
done
|
||||
rm -f "$scratch"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# env
|
||||
# Written in 2019 by Lucas
|
||||
# Written in 2019-2020 by Lucas
|
||||
# CC0 1.0 Universal/Public domain - No rights reserved
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all
|
||||
|
@ -22,7 +22,7 @@ tput rev
|
|||
printf " bg on fg "
|
||||
tput sgr0
|
||||
for i in 0 1 2 3 4 5 6 7; do
|
||||
tput setab $(($i + 8)) 0 0
|
||||
tput setab $((i + 8)) 0 0
|
||||
printf " "
|
||||
done
|
||||
printf "\n"
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
#!/bin/sh
|
||||
# env
|
||||
# Written in 2020 by Lucas
|
||||
# CC0 1.0 Universal/Public domain - No rights reserved
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all
|
||||
# copyright and related and neighboring rights to this software to the
|
||||
# public domain worldwide. This software is distributed without any
|
||||
# warranty. You should have received a copy of the CC0 Public Domain
|
||||
# Dedication along with this software. If not, see
|
||||
# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
usage()
|
||||
{
|
||||
printf "Usage: %s version\n" "${0##*/}" >&2
|
||||
|
@ -16,19 +27,14 @@ isversion()
|
|||
printf "%s\n" "$*" | grep -Eq "^v[0-9]+\.[0-9]+\.[0-9]+$"
|
||||
}
|
||||
|
||||
if [ -z "${RIOT_WEB_UI_DIR:-}" ]; then
|
||||
err "Environment RIOT_WEB_UI_DIR unset"
|
||||
fi
|
||||
|
||||
if [ $# -ne 1 ] || ! isversion "$1"; then
|
||||
usage
|
||||
fi
|
||||
[ -n "${RIOT_WEB_UI_DIR:-}" ] || err "environment var RIOT_WEB_UI_DIR unset"
|
||||
[ $# -eq 1 ] && isversion "$1" || usage
|
||||
ver=$1
|
||||
|
||||
GH_BASE_URL=https://github.com/vector-im/riot-web/releases/download
|
||||
|
||||
cd "$RIOT_WEB_UI_DIR" || err "Can't cd to web UI directory"
|
||||
cd "$RIOT_WEB_UI_DIR" || err "can't cd to web UI directory"
|
||||
ftp -o - "$GH_BASE_URL/$ver/riot-$ver.tar.gz" | pax -rz ||
|
||||
err "Can't fetch and extract release"
|
||||
err "can't fetch and extract release"
|
||||
rm -f riot && ln -s "riot-$ver" riot ||
|
||||
err "Can't point web UI directory to new release"
|
||||
err "can't point web UI directory to new release"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue