2 # Copyright (C) 2019 Ian Kelling
3 # SPDX-License-Identifier: AGPL-3.0-or-later
7 # redirect output to log file. this doesn't work. todo figure out why
8 #exec 1>>/a/tmp/bashlog
9 #exec 2>>/a/tmp/bashlog
12 # History related options first, or else
13 # we risk screwing up history history. And this is duplicated
14 # in ~/.bash_profile just for good measure
15 # history number. History expansion is good.
17 # history file size limit, set to unlimited.
18 # this needs to be different from the default because
19 # default HISTFILESIZE is 500 and could clobber our history
21 # max commands 1 session can append/read from history
23 # the time format display when doing the history command
24 # also, setting this makes the history file record time
25 # of each command as seconds from the epoch
26 HISTTIMEFORMAT
="%Y-%m-%d %I:%M %p "
27 # consecutive duplicate lines dont go in history
28 HISTCONTROL
=ignoredups
29 # works in addition to HISTCONTROL to do more flexible things
30 # it could also do the same things as HISTCONTROL and thus replace it,
31 # but meh. dunno why, but just " *" does glob expansion, so use [ ] to avoid it.
32 HISTIGNORE
='pass *:[ ]*:otp *:oathtool *'
35 # see comments in brc2 sl() function for background.
36 if [[ $SSH_CONNECTION ]] \
37 && [[ $BRC != t
]]; then
41 # the distinction between login and non-login shells is lame,
42 # get rid of it. note ssh shells normally its login if a command is passed
43 if ! shopt -q login_shell
; then
44 if [[ -r /etc
/profile
]]; then
47 # note, this is not exactly the same as a login shell, because that
48 # reads ~/.bash_profile or alternative, which usually just sources
49 # this file, and we don't want to do that and cause an infinite
52 _tmp
=$
(readlink
-f ${BASH_SOURCE[0]})
55 if [[ -s $_tmp2 ]]; then
56 # shellcheck source=./brc
59 # brc2 is for things i dont necessarily want on every system
61 if [[ -s $_tmp2 ]]; then
62 # shellcheck source=./brc2
65 # This check is for when running the sl() command,
66 # and the remote host got its type misidentified.
68 if [[ -s $_tmp2 ]]; then
69 # shellcheck source=./brc2
74 # ensure no bad programs appending to this file will have an affect