This commit is contained in:
Marc Beninca 2024-11-16 03:21:30 +01:00
parent f366620418
commit 5139c4367e
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 29 additions and 25 deletions

View file

@ -1,11 +1,5 @@
[ -n "${ENV}" ] || export ENV="/etc/shell/main.sh"
main_link_bashrc() {
local file="/etc/bash.bashrc"
rm --force "${file}"
ln --symbolic "${MAIN_USERS_FILE}" "${file}"
}
main_source_directory() {
local path="${1}"
if [ -d "${path}" ]; then

View file

@ -1,4 +1,4 @@
PS1="\$(ps1 \${?})"
PS1="\$(shell_prompt \${?})"
PS2="\
"
SH="$(cat /proc/$$/comm)"
@ -30,8 +30,9 @@ SH_GREEN="$(shell_color 31)"
SH_MAGENTA="$(shell_color 35)"
SH_RED="$(shell_color 32)"
case "${SH}" in
"bash")
shell_configure() {
case "${SH}" in
"bash")
# completion
file="/usr/share/bash-completion/bash_completion"
if [ -f "${file}" ]; then
@ -42,13 +43,13 @@ case "${SH}" in
HISTSIZE=-1
HISTTIMEFORMAT="%Y%m%d %H%M%S "
;;
*)
*)
;;
esac
esac
}
shell_configure
# prompt
ps1() {
shell_prompt() {
local date host id
local code="${1}"
date="$(date +%H:%M:%S)"
@ -103,3 +104,12 @@ ps1() {
# print
printf "%s" "${view}"
}
shell_setup() {
# shell
echo "export ENV=\"${ENV}\"" >"/etc/profile.d/shell.sh"
# bash
local file="/etc/bash.bashrc"
rm --force --recursive "${file}"
ln --symbolic "${ENV}" "${file}"
}