mirror of
https://github.com/opensiriusfox/bashrc.d.git
synced 2025-06-20 14:25:50 -07:00
Compare commits
No commits in common. "26b26706023f9b209328ba2203c283b73011e224" and "b21b623273e1078c1928da8afc30f644b2abfdb0" have entirely different histories.
26b2670602
...
b21b623273
3 changed files with 1 additions and 33 deletions
|
@ -69,11 +69,7 @@ echo "##################" >> $COMPILED_SRC
|
||||||
echo "# Reloader Script" >> $COMPILED_SRC
|
echo "# Reloader Script" >> $COMPILED_SRC
|
||||||
echo """##################
|
echo """##################
|
||||||
function __rebuild_bashrcd() {
|
function __rebuild_bashrcd() {
|
||||||
bash \""""$SELF_SRC"""\"
|
bash """$SELF_SRC"""
|
||||||
if [[ \$? -eq 0 && \"\${1}\" == '-a' ]]; then
|
|
||||||
echo "Automatically loading compiled script."
|
|
||||||
source \""""$(readlink -f "$COMPILED_SRC")"""\"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
""" >> $COMPILED_SRC
|
""" >> $COMPILED_SRC
|
||||||
|
|
||||||
|
|
|
@ -114,10 +114,3 @@ function rv() {
|
||||||
printf ' RV=%d \e[0m\n' $RV >&2
|
printf ' RV=%d \e[0m\n' $RV >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
function hexy() {
|
|
||||||
python3 -c 'import sys
|
|
||||||
for v in sys.argv[1:]:
|
|
||||||
print("{:02x}".format(int(v)), end="")
|
|
||||||
print("")
|
|
||||||
' $*
|
|
||||||
}
|
|
||||||
|
|
21
is_remote.sh
21
is_remote.sh
|
@ -1,21 +0,0 @@
|
||||||
# Detect if the current session is running on a remote server by listing parent
|
|
||||||
# processes of this shell and checking for things like sshd/tailscaled. Runs
|
|
||||||
# first because multiple other things rely on this.
|
|
||||||
|
|
||||||
|
|
||||||
function __is_remote() {
|
|
||||||
# names of daemon processes a remote shell might be a child process of
|
|
||||||
remote_daemons=(
|
|
||||||
sshd
|
|
||||||
)
|
|
||||||
|
|
||||||
is_remote=()
|
|
||||||
parent_procs="$(pstree -s $$)"
|
|
||||||
for d in ${remote_daemons[@]}; do
|
|
||||||
if [[ "$parent_procs" =~ "$d" ]]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue