1. Beatrix Willius
  2. Valentina Server
  3. Sunday, May 14 2023, 10:58 AM
  4.  Subscribe via email
Since a while I use a custom installer for Valentina Server which is really nice.

Today I noticed that the verbose level is set to 2:

; Specifies how much information produce in logs:
; 0 - display error messages only.
; 1 - display errors and warnings.
; 2 - display errors, warnings and debugging messages.
; 3 - display errors, warnings, debugging messages and command level tracing.
VerboseLevel=2

Is there a simple way to set that to 1 when creating the installer?

Valentina Server latest version.
Comment
There are no comments made yet.
Ivan Smahin Accepted Answer
Hi Beatrix.

I'm not sure what you mean, but you may use something like this one:

sed -i -e 's/VerboseLevel=2/VerboseLevel=1/g' path_to_ini_file
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 1
Beatrix Willius Accepted Answer
I don't want Valentina Server to be installed with verbose level 2.

If I change the value with sed then the installer would reset the value whenever Valentina Server is installed. I would like to change the value only for the first installation and not when the installer is run again.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 2
Ivan Smahin Accepted Answer
Well, you need something to differentiate the first-time script running moment - right?

Probably just check ini file existence?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 3
Beatrix Willius Accepted Answer
Yes, that should work.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 4
Personally, I include in the installer the VServer.ini file with my parameters.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 5
Beatrix Willius Accepted Answer
Also a good idea.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 6
Beatrix Willius Accepted Answer
@François Van Lerberghe: If I include the ini file in the installer wouldn't that reset the parameters when installing a new version?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 7
Beatrix Willius Accepted Answer
After doing a test the parameters are indeed reset. Is there a way to tell the installer not to update a file?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 8
I think you could be able to test if the file exist before copy it
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 9
Beatrix Willius Accepted Answer
As always I wanted to be lazy and not muck around with shell scripting.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 10
Beatrix Willius Accepted Answer
Got it:


#copy the ini file if it doesn't exist
SRC_FILE="$1/vserver_x64.ini"
DEST_FILE="/Library/VServer_x64/vserver_x64.ini"

# Check if the file already exists in the destination directory
if [ -e "$DEST_FILE" ]; then
echo "File $DEST_FILE already exists, skipping copy."
else
# Copy the file from package resources to the destination directory
cp "$SRC_FILE" "$DEST_FILE"

# Make sure the file has the correct ownership and permissions
chown root:admin "$DEST_FILE"
chmod 644 "$DEST_FILE"
fi
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 11
Thanks for sharing
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 12
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.