File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,19 +71,20 @@ sudo systemctl restart "$SERVICE_NAME"
7171
7272# Ensure .env file exists in /home/coda/simpleprint
7373
74- # Use ~/.simpleprint/.env for environment
75- ENV_DIR=" $HOME /.simpleprint"
74+
75+ # Use /etc/simpleprint/.env for environment
76+ ENV_DIR=" /etc/simpleprint"
7677ENV_FILE=" $ENV_DIR /.env"
7778if [ ! -d " $ENV_DIR " ]; then
78- mkdir -p " $ENV_DIR "
79+ sudo mkdir -p " $ENV_DIR "
7980fi
8081if [ ! -f " $ENV_FILE " ]; then
8182 echo " .env not found in $ENV_DIR . Creating a default .env file..."
8283 RAW_ENV_URL=" https://raw.githubusercontent.com/${REPO} /${TAG} /lib/example.env"
8384 if curl --output /dev/null --silent --head --fail " $RAW_ENV_URL " ; then
84- curl -L " $RAW_ENV_URL " -o " $ENV_FILE "
85+ sudo curl -L " $RAW_ENV_URL " -o " $ENV_FILE "
8586 else
86- cat << EOF > "$ENV_FILE "
87+ sudo tee " $ENV_FILE " > /dev/null << EOF
8788# Default environment for simpleprint
8889PRINTER_DEVICE=/dev/usb/lp0
8990LOG_LEVEL=info
You can’t perform that action at this time.
0 commit comments