Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

questions udated readme #30

Closed
wants to merge 11 commits into from
Next Next commit
Added Runtime Conditions.
Tearran committed Dec 15, 2023
commit 96d17ccc320c54fb8984e7faf13dfa516b9718bd
35 changes: 35 additions & 0 deletions lib/armbian-configng/runtime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# lib/armbian-configng/runtime-conditions.sh

# File extention of the config file
config_format="conf"
# Path to the config file

config_file="$etcpath"/"$filename"/"$filename"."$config_format"

# Check if the config file exists
if [[ ! -f "$config_file" ]]; then

[[ -d "$etcpath"/"$filename" ]] || mkdir -p "$etcpath"/"$filename"
# If not, create it
echo "Creating $config_file..."
touch "$config_file"

# You can also set some default values here if needed
echo "VAR1=default_value1" >> "$config_file"
echo "VAR2=default_value2" >> "$config_file"
cat << EOF > "$config_file"
# PLEASE DO NOT EDIT THIS FILE
# This file is automatically generated by $filename
# Any changes made to this file will be overwritten the next time the script runs.
# To change the values of these variables, Setup a funtion to...

# Default values for variables that can be read and modified by the User Interface.
# These variables can be toggled or their state can be changed as per user request.
VAR1=default_value1
VAR2=default_value2


EOF

# And so on...
fi