Compare commits

..

No commits in common. "979978a7f83644e6e55bc8be00580c3c060f1d15" and "4e5b2a848e21c3f5817d6ea5208e77ec5e2a5282" have entirely different histories.

2 changed files with 8 additions and 15 deletions

View file

@ -35,7 +35,6 @@ uninstall () {
echo "Goodbye. Uninstalling..." echo "Goodbye. Uninstalling..."
tput sc tput sc
rm ~/.welcome/welcome.sh 2> /dev/null rm ~/.welcome/welcome.sh 2> /dev/null
rm ~/.welcome/install.sh 2> /dev/null
rm ~/.welcome/config.cfg 2> /dev/null rm ~/.welcome/config.cfg 2> /dev/null
rm ~/.welcome/config_old.cfg 2> /dev/null rm ~/.welcome/config_old.cfg 2> /dev/null
rm -r ~/.welcome rm -r ~/.welcome
@ -58,18 +57,13 @@ uninstall () {
} }
update () { update () {
# To monitor number of downloads/updates
curl https://g2games.dev/Assets/counter/counter.php
tput rc el ed tput rc el ed
echo "Updating..." echo "Updating..."
tput sc tput sc
mkdir -p ~/.welcome mkdir -p ~/.welcome
rm ~/.welcome/welcome.sh rm ~/.welcome/welcome.sh
rm ~/.welcome/install.sh
curl -SL https://github.com/G2-Games/welcome.sh/releases/download/v"${version}"/welcome.sh --output ~/.welcome/welcome.sh curl -SL https://github.com/G2-Games/welcome.sh/releases/download/v"${version}"/welcome.sh --output ~/.welcome/welcome.sh
curl -SL https://raw.githubusercontent.com/G2-Games/welcome.sh/main/install.sh --output ~/.welcome/install.sh
if [[ $vernum -ge 100 ]] && [[ $overcfg -gt 0 ]]; then if [[ $vernum -ge 100 ]] && [[ $overcfg -gt 0 ]]; then
echo "Backing up: config.cfg >> config_old.cfg" echo "Backing up: config.cfg >> config_old.cfg"
mv ~/.welcome/config.cfg ~/.welcome/config_old.cfg mv ~/.welcome/config.cfg ~/.welcome/config_old.cfg
@ -134,9 +128,6 @@ fi
if ! grep -qs 'bash ~/.welcome/welcome.sh' $bashrc && ! grep -qs 'zsh ~/.welcome/welcome.sh' $zshrc && ! grep -qs 'bash /home/$USER/.welcome/welcome.sh' $bashrc && ! grep -qs 'zsh /home/$USER/.welcome/welcome.sh' $zshrc; then if ! grep -qs 'bash ~/.welcome/welcome.sh' $bashrc && ! grep -qs 'zsh ~/.welcome/welcome.sh' $zshrc && ! grep -qs 'bash /home/$USER/.welcome/welcome.sh' $bashrc && ! grep -qs 'zsh /home/$USER/.welcome/welcome.sh' $zshrc; then
#==== Execute if first time installing...====# #==== Execute if first time installing...====#
# To monitor number of downloads/updates
curl https://g2games.dev/Assets/counter/counter.php
tput rc tput rc
echo "Welcome! Installing v$version in $environment..." echo "Welcome! Installing v$version in $environment..."
tput sc tput sc
@ -144,8 +135,6 @@ if ! grep -qs 'bash ~/.welcome/welcome.sh' $bashrc && ! grep -qs 'zsh ~/.welcome
cd ~/ || exit 1 cd ~/ || exit 1
mkdir -p ~/.welcome mkdir -p ~/.welcome
curl -SL https://github.com/G2-Games/welcome.sh/releases/download/v"${version}"/welcome.sh --output ~/.welcome/welcome.sh curl -SL https://github.com/G2-Games/welcome.sh/releases/download/v"${version}"/welcome.sh --output ~/.welcome/welcome.sh
curl -SL https://raw.githubusercontent.com/G2-Games/welcome.sh/main/install.sh --output ~/.welcome/install.sh
if [[ $vernum -ge 100 ]]; then if [[ $vernum -ge 100 ]]; then
curl -SL https://github.com/G2-Games/welcome.sh/releases/download/v"${version}"/config.cfg --output ~/.welcome/config.cfg curl -SL https://github.com/G2-Games/welcome.sh/releases/download/v"${version}"/config.cfg --output ~/.welcome/config.cfg
fi fi

View file

@ -1,8 +1,12 @@
# Bash "strict mode" => http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
export LC_NUMERIC="en_US.UTF-8" &> /dev/null #Fix for locales that use , instead of . as a decimal delimiter export LC_NUMERIC="en_US.UTF-8" &> /dev/null #Fix for locales that use , instead of . as a decimal delimiter
# Define "global" variables # Define "global" variables
environment=$(ps -o args= -p $$ | grep -Em 1 -o '\w{0,5}sh' | head -1) environment=$(ps -o args= -p $$ | grep -Em 1 -o '\w{0,5}sh' | head -1)
version=1.1.2 version=1.1.0
#========Welcome=======# #========Welcome=======#
welcome () { welcome () {
@ -19,7 +23,7 @@ welcome () {
fi fi
if [ "$randgreeting" = "on" ]; then if [ "$randgreeting" = "on" ]; then
msg=${greetings[@]:$greetingsNumber:1} msg=${greetings[$greetingsNumber]}
fi fi
# Print the welcome message # Print the welcome message
@ -266,9 +270,9 @@ lastdate=$(cat ~/.welcome/udm 2>/dev/null)
if [[ $((date - lastdate)) -ge 86400 ]]; then if [[ $((date - lastdate)) -ge 86400 ]]; then
if [[ "$environment" = "bash" ]]; then if [[ "$environment" = "bash" ]]; then
bash ~/.welcome/install.sh auto bash install.sh auto
elif [[ "$environment" = "zsh" ]]; then elif [[ "$environment" = "zsh" ]]; then
zsh ~/.welcome/install.sh auto zsh install.sh auto
fi fi
date +%s >| ~/.welcome/udm 2>/dev/null date +%s >| ~/.welcome/udm 2>/dev/null
elif ! [[ -f ~/.welcome/udm ]]; then elif ! [[ -f ~/.welcome/udm ]]; then