fixes
This commit is contained in:
parent
f366620418
commit
5139c4367e
2 changed files with 29 additions and 25 deletions
|
@ -1,11 +1,5 @@
|
||||||
[ -n "${ENV}" ] || export ENV="/etc/shell/main.sh"
|
[ -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() {
|
main_source_directory() {
|
||||||
local path="${1}"
|
local path="${1}"
|
||||||
if [ -d "${path}" ]; then
|
if [ -d "${path}" ]; then
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
PS1="\$(ps1 \${?})"
|
PS1="\$(shell_prompt \${?})"
|
||||||
PS2="\
|
PS2="\
|
||||||
├ "
|
├ "
|
||||||
SH="$(cat /proc/$$/comm)"
|
SH="$(cat /proc/$$/comm)"
|
||||||
|
@ -30,25 +30,26 @@ SH_GREEN="$(shell_color 31)"
|
||||||
SH_MAGENTA="$(shell_color 35)"
|
SH_MAGENTA="$(shell_color 35)"
|
||||||
SH_RED="$(shell_color 32)"
|
SH_RED="$(shell_color 32)"
|
||||||
|
|
||||||
case "${SH}" in
|
shell_configure() {
|
||||||
"bash")
|
case "${SH}" in
|
||||||
# completion
|
"bash")
|
||||||
file="/usr/share/bash-completion/bash_completion"
|
# completion
|
||||||
if [ -f "${file}" ]; then
|
file="/usr/share/bash-completion/bash_completion"
|
||||||
. "${file}"
|
if [ -f "${file}" ]; then
|
||||||
fi
|
. "${file}"
|
||||||
# history
|
fi
|
||||||
HISTCONTROL="ignorespace"
|
# history
|
||||||
HISTSIZE=-1
|
HISTCONTROL="ignorespace"
|
||||||
HISTTIMEFORMAT="%Y%m%d %H%M%S "
|
HISTSIZE=-1
|
||||||
;;
|
HISTTIMEFORMAT="%Y%m%d %H%M%S "
|
||||||
*)
|
;;
|
||||||
;;
|
*)
|
||||||
esac
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
shell_configure
|
||||||
|
|
||||||
# prompt
|
shell_prompt() {
|
||||||
|
|
||||||
ps1() {
|
|
||||||
local date host id
|
local date host id
|
||||||
local code="${1}"
|
local code="${1}"
|
||||||
date="$(date +%H:%M:%S)"
|
date="$(date +%H:%M:%S)"
|
||||||
|
@ -103,3 +104,12 @@ ps1() {
|
||||||
# print
|
# print
|
||||||
printf "%s" "${view}"
|
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}"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue