summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/90-patch_misc_files.inc
diff options
context:
space:
mode:
Diffstat (limited to 'satellit_installer/includes/90-patch_misc_files.inc')
-rw-r--r--satellit_installer/includes/90-patch_misc_files.inc40
1 files changed, 11 insertions, 29 deletions
diff --git a/satellit_installer/includes/90-patch_misc_files.inc b/satellit_installer/includes/90-patch_misc_files.inc
index 45c220f..90b00da 100644
--- a/satellit_installer/includes/90-patch_misc_files.inc
+++ b/satellit_installer/includes/90-patch_misc_files.inc
@@ -3,29 +3,17 @@ patch_bashrc() {
echo "# As one of the last things here we will set a new prompt to distinguish"
echo "# the bwLehrpool satellite server from other servers. To accomplish this"
echo "# we will set a very classy prompt. This will take effect at next root login."
- local ifname=$( ifconfig | grep -oEm1 '^e\w+' )
- echo "# Setting prompt..."
- if grep -q '^IP=' /root/.bashrc; then
- echo "...already done."
- else
- sed "s/%ifname%/$ifname/g" >> /root/.bashrc <<-"ENDO"
- IP=$( ip -4 a show "%ifname%" 2>/dev/null | grep '^\s*inet\s' | awk -F ' ' '{print $2}' )
- [ -z "$IP" ] && IP=$(ip -4 a | grep '^\s*inet\s'| grep -v '127.0.0' | head -n 1 | awk -F ' ' '{print $2}')
- IP=${IP%/*}
- [ -z "$IP" ] && IP="noip???"
- PS1="\[\033[01;31m\]\u\[\033[00m\]@\[\033[01;32m\]\h \[\033[00m\]($IP)
- \[\033[01;34m\]\w\[\033[00m\] # "
- ENDO
- fi
- # aliases, dircolors
- sed -i -r 's/# *(alias|export LS|eval ")/\1/' /root/.bashrc
-}
-
-patch_vim() {
- sed -i -r 's/" *(syntax|set showmatch|set smartcase|set incsearch)/\1/' /etc/vim/vimrc
- echo "set autoindent" >> /etc/vim/vimrc
- echo "set smartindent" >> /etc/vim/vimrc
+ for f in /root/ /home/*/; do
+ [ -d "$f" ] || continue # Not dir
+ f="$f/.bashrc"
+ [ -f "$f" ] || cp /etc/skel/.bashrc "$f" # Make sure default exists
+ grep -qF '/opt/openslx/bashrc.inc' "$f" && continue # Already patched
+ # This include will set our two-line prompt including the IP address
+ echo ". /opt/openslx/bashrc.inc" >> "$f"
+ # enable aliases, dircolors
+ sed -i -r 's/^(\s*)#\s*(alias|export LS|export GCC|eval )/\1\2/' "$f"
+ done
}
patch_ldapsearch() {
@@ -37,11 +25,5 @@ patch_ldapsearch() {
patch_java() {
# Fix svg renderer:
# java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper
- sed -i -e '/^assistive_technologies=/s/^/#/' /etc/java-*-openjdk/accessibility.properties &> /dev/null
-}
-
-set_version_string() {
- echo -n "# Setting version string..."
- echo 'VERSION="'$VERSION'"' >> "$CONFIGDIR"/config
- echo "ok."
+ sed -i -e '/^assistive_technologies=/s/^/#/' /etc/java-*/accessibility.properties &> /dev/null
}