adding echo lines because i cant figure out why it wont work under

userspace.
This commit is contained in:
zebra 2024-07-24 15:44:11 -07:00
parent 6c3acbb3fc
commit 570ffd4115

View File

@ -12,25 +12,32 @@ fishconfig="https://git.izebra.net/izebra_projects/rmm-scripts/raw/branch/main/c
starshipconfig="https://git.izebra.net/izebra_projects/rmm-scripts/raw/branch/main/config-files/starship.toml"
#Check for updates
echo Checking for updates...
sudo apt update
#install fish and copy config file to root and all users under /home/
echo Installing Fish...
sudo apt install fish -y
echo Downloading Fish Config File. Storing in $HOME/.config/fish/config.fish
wget -O "$HOME/.config/fish/config.fish" $fishconfig
# Iterate over each user's home directory, including /root
for homedir in /root /home/*; do
if [ -d "$homedir" ]; then
# Ensure .config directory exists
echo Creating dir structure for $homedir
mkdir -p "$homedir/.config"
mkdir -p "$homedir/.config/fish"
# Copy starship.toml to the user's .config directory
echo copying fish config to $homedir/.config/fish/config.fish
cp -f "$HOME/.config/fish/config.fish" "$homedir/.config/fish/config.fish"
# Set ownership to the user of the home directory
echo Taking ownership of file under UID $homedir
chown $(basename "$homedir"):"$(id -gn $(basename "$homedir"))" "$homedir/.config/fish/config.fish"
# Optional: Set permissions to 0644 (readable by owner and group, readable by others)
echo setting file perms
chmod 0644 "$homedir/.config/fish/config.fish"
fi
done
@ -39,6 +46,7 @@ done
curl https://pyenv.run | bash
#Download starship and copy config file to root and all users under /home/
echo Downloading starship installer to $HOME/starship.sh
wget -O $HOME/starship.sh https://starship.rs/install.sh
chmod +x $HOME/starship.sh
sh $HOME/starship.sh --force
@ -49,12 +57,15 @@ wget -O "$HOME/.config/starship.toml" $starshipconfig
for homedir in /root /home/*; do
if [ -d "$homedir" ]; then
# Ensure .config directory exists
echo Creating directories for $homedir
mkdir -p "$homedir/.config"
# Copy starship.toml to the user's .config directory
echo Copying config file to $homedir/.config/starship.toml
cp -f "$HOME/.config/starship.toml" "$homedir/.config/starship.toml"
# Set ownership to the user of the home directory
echo Setting ownership for $homedir
chown $(basename "$homedir"):"$(id -gn $(basename "$homedir"))" "$homedir/.config/starship.toml"
# Optional: Set permissions to 0644 (readable by owner and group, readable by others)
@ -63,6 +74,7 @@ for homedir in /root /home/*; do
done
#Change default shell to fish
echo Changing default shell to fish
chsh -s /usr/bin/fish