Skip to content

Commit

Permalink
added option to check if the default shell is bash or zsh, upon insta…
Browse files Browse the repository at this point in the history
…llation
  • Loading branch information
talesam committed Nov 18, 2023
1 parent c2ff1ae commit 903aa33
Showing 1 changed file with 41 additions and 6 deletions.
47 changes: 41 additions & 6 deletions usr/bin/calamares-biglinux
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ fi
ruscherrelease=$(cat /etc/big-release | grep RELEASE | awk -F'=' '{print $2}')
ruschertimestamp=$(cat /etc/big-release | grep TIMESTAMP | awk -F'=' '{print $2}')

# Default Shell in stable
# userShell="/bin/bash"
userShell="/bin/zsh"
if [ -n "$(cat /etc/big-release | grep development)" ];then
# Default Shell in testing
# userShell="/bin/zsh"
# Define the shells to be tested
shells=("/bin/bash" "/bin/zsh")

# Verifica se está em uma versão de desenvolvimento
if [ -n "$(cat /etc/big-release | grep development)" ]; then
# Check the validity of the ISO
if [ -z "$(curl -s https://raw.githubusercontent.com/BigLinux-Package-Build/big-releases/main/testing | grep $ruscherrelease | grep -v "#")" ]; then
echo "ISO invalida"
yad --attach="$windowID" --image=emblem-warning --image-on-top --form --width=500 --height=100 --fixed \
Expand All @@ -64,9 +64,44 @@ if [ -n "$(cat /etc/big-release | grep development)" ];then
sudo pacman -R calamares-biglinux calamares --noconfirm
find $HOME -name calamares-biglinux.desktop -exec rm {} +
exit 1
else
# Try to use the defined shells
for shell in "${shells[@]}"; do
if [ -x "$shell" ]; then
userShell="$shell"
break
fi
done

# Check if a valid shell was found
if [ -z "$userShell" ]; then
echo "Nenhum shell válido encontrado."
exit 1
fi
fi
fi

# # Default Shell in stable
# # userShell="/bin/bash"
# userShell="/bin/zsh"
# if [ -n "$(cat /etc/big-release | grep development)" ];then
# # Default Shell in testing
# # userShell="/bin/zsh"
# if [ -z "$(curl -s https://raw.githubusercontent.com/BigLinux-Package-Build/big-releases/main/testing | grep $ruscherrelease | grep -v "#")" ]; then
# echo "ISO invalida"
# yad --attach="$windowID" --image=emblem-warning --image-on-top --form --width=500 --height=100 --fixed \
# --align=center \
# --field=$"<b>Essa Versão de desenvolvimento está ultrapassada e não pode mais ser usada.</b>
# :LBL" \
# --button=$" OK":0 \
# --center --on-top --borders=20 --title=$"Versão Desatualizada" \
# --window-icon=emblem-warning
# sudo pacman -R calamares-biglinux calamares --noconfirm
# find $HOME -name calamares-biglinux.desktop -exec rm {} +
# exit 1
# fi
# fi

# disable swap on disk
for diskswap in $(blkid | grep 'TYPE="swap"' | grep -v zram | cut -f1 -d:)
do
Expand Down

0 comments on commit 903aa33

Please sign in to comment.