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
13 # History related options first, or else
14 # we risk screwing up history history. And this is duplicated
15 # in ~/.bash_profile just for good measure
16 # history number. History expansion is good.
18 # history file size limit, set to unlimited.
19 # this needs to be different from the default because
20 # default HISTFILESIZE is 500 and could clobber our history
22 # max commands 1 session can append/read from history
24 # the time format display when doing the history command
25 # also, setting this makes the history file record time
26 # of each command as seconds from the epoch
27 HISTTIMEFORMAT
="%Y-%m-%d %I:%M %p "
28 # consecutive duplicate lines dont go in history
29 HISTCONTROL
=ignoredups
30 # works in addition to HISTCONTROL to do more flexible things
31 # it could also do the same things as HISTCONTROL and thus replace it,
32 # but meh. dunno why, but just " *" does glob expansion, so use [ ] to avoid it.
33 HISTIGNORE
='pass *:[ ]*:otp *:oathtool *'
36 # see comments in brc2 sl() function for background.
37 if [[ $SSH_CONNECTION ]] \
38 && [[ $BRC != t
]]; then
42 # the distinction between login and non-login shells is lame,
43 # get rid of it. note ssh shells normally its login if a command is passed
44 if ! shopt -q login_shell
; then
45 if [[ -r /etc
/profile
]]; then
48 # note, this is not exactly the same as a login shell, because that
49 # reads ~/.bash_profile or alternative, which usually just sources
50 # this file, and we don't want to do that and cause an infinite
53 _tmp
=$
(readlink
-f ${BASH_SOURCE[0]})
56 if [[ -s $_tmp2 ]]; then
57 # shellcheck source=./brc
60 # brc2 is for things i dont necessarily want on every system
62 if [[ -s $_tmp2 ]]; then
63 # shellcheck source=./brc2
66 # This check is for when running the sl() command,
67 # and the remote host got its type misidentified.
69 if [[ -s $_tmp2 ]]; then
70 # shellcheck source=./brc2
77 # ensure no bad programs appending to this file will have an affect