Renamed and moved from Dash to Ash

This commit is contained in:
Jack-Benny Persson 2014-01-08 16:57:03 +01:00
parent dfa8b8f515
commit 41afd423d9
7 changed files with 18 additions and 20 deletions

View File

@ -1,5 +1,5 @@
FILES=shellchooser.sh bashfiles/.profile bashfiles/.bashrc cshfiles/.cshrc \
dashfiles/.profile
FILES=shellchooser.sh bashfiles/profile bashfiles/bashrc cshfiles/cshrc \
ashfiles/profile
shellchooser: $(FILES)
$(info Use 'make install' to install shellchooser on your system)
@ -12,7 +12,7 @@ install: $(FILES)
mkdir /etc/shellchooser
cp -r bashfiles /etc/shellchooser/bashfiles
cp -r cshfiles /etc/shellchooser/cshfiles
cp -r dashfiles /etc/shellchooser/dashfiles
cp -r ashfiles /etc/shellchooser/ashfiles
uninstall:
rm /bin/shellchooser.sh

3
ashfiles/profile Normal file
View File

@ -0,0 +1,3 @@
# Placeholder for Ash-profile

View File

@ -127,7 +127,7 @@ unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
xterm-256color|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)

View File

@ -1,5 +0,0 @@
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

View File

@ -34,7 +34,7 @@ Binaries=(clear cp printf cat mktemp rm tail dialog diff)
# Variables
BashFiles="/etc/shellchooser/bashfiles"
CshFiles="/etc/shellchooser/cshfiles"
DashFiles="/etc/shellchooser/dashfiles"
DashFiles="/etc/shellchooser/ashfiles"
### Functions ###
@ -68,7 +68,7 @@ chooser()
Temp=`$Mktemp -t chooser.XXXX`
$Dialog --backtitle "Shell Chooser" \
--menu "Choose your shell" 10 60 3 "/bin/bash" Bash \
"/bin/dash" Dash "/bin/csh" Csh 2> $Temp
"/bin/ash" Ash "/bin/csh" Csh 2> $Temp
if [ $? -ne 0 ]; then
return 1
fi
@ -81,25 +81,25 @@ check_env()
{
case $Shell in
"/bin/bash")
$Diff ${HOME}/.profile ${BashFiles}/.profile &> /dev/null
$Diff ${HOME}/.profile ${BashFiles}/profile &> /dev/null
if [ $? -ne 0 ]; then
$Cp ${BashFiles}/.profile ${HOME}
$Cp ${BashFiles}/profile ${HOME}/.profile
fi
$Diff ${HOME}/.bashrc ${BashFiles}/.bashrc &> /dev/null
$Diff ${HOME}/.bashrc ${BashFiles}/bashrc &> /dev/null
if [ $? -ne 0 ]; then
$Cp ${BashFiles}/.bashrc ${HOME}
$Cp ${BashFiles}/bashrc ${HOME}/.bashrc
fi
;;
"/bin/csh")
$Diff ${HOME}/.cshrc ${CshFiles}/.cshrc &> /dev/null
$Diff ${HOME}/.cshrc ${CshFiles}/cshrc &> /dev/null
if [ $? -ne 0 ]; then
$Cp ${CshFiles}/.cshrc ${HOME}
$Cp ${CshFiles}/cshrc ${HOME}/.cshrc
fi
;;
"/bin/dash")
$Diff ${HOME}/.profile ${DashFiles}./profile
"/bin/ash")
$Diff ${HOME}/.profile ${AshFiles}/profile
if [ $? -ne 0 ]; then
$Cp ${DashFiles}/.profile ${HOME}
$Cp ${AshFiles}/profile ${HOME}/.profile
fi
esac
}