uci-docker-build/distros/common/ucishell.sh

24 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/bash
DIR=$(cd "$(dirname "$BASH_SOURCE")" >/dev/null 2>&1 ; pwd -P )
if [ $EUID != 0 ]; then
sudo $DIR/deploy.sh $(whoami)
fi
BASH_SHELL_BASE="$(dirname $DIR)"
echo Base Shell Directory as detected is $BASH_SHELL_BASE
echo -----------------;echo deploying /etc shell files
files=$(find $BASH_SHELL_BASE/setup/etc/ -maxdepth 1 -type f)
for file in $files; do install -m 644 -o root -g root $file /etc; done
echo setting BASH_SHELL_BASE to $BASH_SHELL_BASE in etc/bash.bashrc and /etc/profile
sed -i 's:_BASH_SHELL_BASE_:'${BASH_SHELL_BASE}':' /etc/bash.bashrc
sed -i 's:BASH_SHELL_BASE=.*:BASH_SHELL_BASE='${BASH_SHELL_BASE}':' /etc/profile
files=$(find $BASH_SHELL_BASE/setup/etc/profile.d -maxdepth 1 -type f)
for file in $files; do install -m 644 -o root -g root $file /etc/profile.d; done
echo -----------------;echo deploying /root shell files
group=root
files=$(find $BASH_SHELL_BASE/setup/root/ -type f)
for file in $files; do install -m 640 -o root -g $group $file /root; done
echo -----------------