1. Beatrix Willius
  2. Valentina Server
  3. Sonntag, Mai 14 2023, 10:58 AM
  4.  Abonnieren via E-Mail
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.
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
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
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Well, you need something to differentiate the first-time script running moment - right?

Probably just check ini file existence?
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Yes, that should work.
Kommentar
There are no comments made yet.
François Van Lerberghe Akzeptierte Antwort
Personally, I include in the installer the VServer.ini file with my parameters.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Also a good idea.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
@François Van Lerberghe: If I include the ini file in the installer wouldn't that reset the parameters when installing a new version?
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
After doing a test the parameters are indeed reset. Is there a way to tell the installer not to update a file?
Kommentar
There are no comments made yet.
François Van Lerberghe Akzeptierte Antwort
I think you could be able to test if the file exist before copy it
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
As always I wanted to be lazy and not muck around with shell scripting.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
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
Kommentar
There are no comments made yet.
François Van Lerberghe Akzeptierte Antwort
Thanks for sharing
Kommentar
There are no comments made yet.
  • Seite :
  • 1


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

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories