# Set default valuesmove=""embedded=""venv=""rpi=""bot=""meshbotservice=""emoji=""ollama=""gemma=""reboot=""# Function to prompt user only if variable is unset
prompt_if_unset(){localvar_name=$1localprompt_text=$2localvar_value=${!var_name}# Get variable value dynamicallyif[[ -z "$var_value"]];thenread -p "$prompt_text (y/n): " var_value
fi# Ensure input is only "y" or "n"while[[ ! "$var_value"=~ ^[yYnN]$ ]];doread -p "Invalid input. $prompt_text (y/n): " var_value
done# Convert to lowercase to avoid case issueseval"$var_name=$(echo"$var_value"| tr '[:upper:]''[:lower:]')"}# Parse command-line arguments using a switch-casewhile[[$# -gt 0]];docase$1 in
--move)move=$2;;
--embedded)embedded=$2;;
--venv)venv=$2;;
--rpi)rpi=$2;;
--bot)bot=$2;;
--meshbotservice)meshbotservice=$2;;
--emoji)emoji=$2;;
--ollama)ollama=$2;;
--gemma)gemma=$2;;
--reboot)reboot=$2;;
*)echo"Unknown option: $1"exit1;;esacshift2# Move to next argument pairdone
prompt_if_unset move "Do you want to move the project to /opt/meshing-around?"
Example. This would be ran ~/meshing-around/install.sh --move y
and then this /opt/meshing-around/install.sh --embedded n --venv y --rpi y --bot mesh --meshbotservice y --emoji y --ollama n --gemma n --reboot n
```shell
# Set default values
move=""
embedded=""
venv=""
rpi=""
bot=""
meshbotservice=""
emoji=""
ollama=""
gemma=""
reboot=""
# Function to prompt user only if variable is unset
prompt_if_unset() {
local var_name=$1
local prompt_text=$2
local var_value=${!var_name} # Get variable value dynamically
if [[ -z "$var_value" ]]; then
read -p "$prompt_text (y/n): " var_value
fi
# Ensure input is only "y" or "n"
while [[ ! "$var_value" =~ ^[yYnN]$ ]]; do
read -p "Invalid input. $prompt_text (y/n): " var_value
done
# Convert to lowercase to avoid case issues
eval "$var_name=$(echo "$var_value" | tr '[:upper:]' '[:lower:]')"
}
# Parse command-line arguments using a switch-case
while [[ $# -gt 0 ]]; do
case $1 in
--move) move=$2 ;;
--embedded) embedded=$2 ;;
--venv) venv=$2 ;;
--rpi) rpi=$2 ;;
--bot) bot=$2 ;;
--meshbotservice) meshbotservice=$2 ;;
--emoji) emoji=$2 ;;
--ollama) ollama=$2 ;;
--gemma) gemma=$2 ;;
--reboot) reboot=$2 ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift 2 # Move to next argument pair
done
prompt_if_unset move "Do you want to move the project to /opt/meshing-around?"
```
Example. This would be ran
`~/meshing-around/install.sh --move y`
and then this
`/opt/meshing-around/install.sh --embedded n --venv y --rpi y --bot mesh --meshbotservice y --emoji y --ollama n --gemma n --reboot n`
<!-- github-sync-id:2824606362 -->
I have a soft change freeze on this file for the moment till femtofox launches make sure no issues. I will try and port this in at some point in the future 🛸🛰️🔭
I have a soft change freeze on this file for the moment till femtofox launches make sure no issues. I will try and port this in at some point in the future 🛸🛰️🔭
<!-- github-comment-id:2660683186 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Example. This would be ran
~/meshing-around/install.sh --move yand then this
/opt/meshing-around/install.sh --embedded n --venv y --rpi y --bot mesh --meshbotservice y --emoji y --ollama n --gemma n --reboot nI have a soft change freeze on this file for the moment till femtofox launches make sure no issues. I will try and port this in at some point in the future 🛸🛰️🔭
this is being marked finished in lates pull.