3
2
Fork
You've already forked timecheck
5

Installer creates duplicate entries in config file #5

Closed
opened 2020年05月16日 14:34:07 +02:00 by errhammr · 1 comment
Contributor
Copy link

I installed timecheck (version: Commit 6f836aeb42) using the installer and it asked me for the username and the usage time spans. So I typed in the username errhammr and 120 for both time spans.

Looking into the config file unter /opt/timecheck/timecheck.conf I found the following:

# This script is released under the GPLv3 license
# See COPYING file for more information
# Please replace 'YourUserHere' with the account name of the user that you want to control
USER=YourUserHere
# Insert the maximum available time in minutes. 
# TIME_MOFR for the time from Monday 0:00 to Friday 23:59
TIME_MOFR=100
# TIME_SASU for the time form Saturday 0:00 to Sunday 23:59 
TIME_SASU=100
# change only if you want to be notified earlyer then 10 minutes before automated loggout. See README for further information.
EXIT_SCRIPT=11
USER=errhammr
TIME_MOFR=120
TIME_SASU=120

It seems to me that the installer copies the example config file and appends the user defined values to it. Expected behavior would be to replace the default values with the user defined ones instead of appending them.

I'll see if I can provide a pull request to fix that using sed or something.

I installed timecheck (version: Commit 6f836aeb42add85beaeb05a46c2a9e2c0a68bcfc) using the installer and it asked me for the username and the usage time spans. So I typed in the username `errhammr` and `120` for both time spans. Looking into the config file unter `/opt/timecheck/timecheck.conf` I found the following: ``` # This script is released under the GPLv3 license # See COPYING file for more information # Please replace 'YourUserHere' with the account name of the user that you want to control USER=YourUserHere # Insert the maximum available time in minutes. # TIME_MOFR for the time from Monday 0:00 to Friday 23:59 TIME_MOFR=100 # TIME_SASU for the time form Saturday 0:00 to Sunday 23:59 TIME_SASU=100 # change only if you want to be notified earlyer then 10 minutes before automated loggout. See README for further information. EXIT_SCRIPT=11 USER=errhammr TIME_MOFR=120 TIME_SASU=120 ``` It seems to me that the installer copies the example config file and appends the user defined values to it. Expected behavior would be to replace the default values with the user defined ones instead of appending them. I'll see if I can provide a pull request to fix that using `sed` or something.
Owner
Copy link

Right.
There were two different strands of thoughts..

My first idea was to create an example config file where you just need to fill in everything correctly.

The second idea is the install script. Due to the install script, you do not need to change the config file by hand, so the first lines are not needed any longer.

But: I guess it will not lead to any issues, due the last value will be read from the main script.

Right. There were two different strands of thoughts.. My first idea was to create an example config file where you just need to fill in everything correctly. The second idea is the install script. Due to the install script, you do not need to change the config file by hand, so the first lines are not needed any longer. But: I guess it will not lead to any issues, due the last value will be read from the main script.
Sign in to join this conversation.
No Branch/Tag specified
master
testing
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nuron/timecheck#5
Reference in a new issue
nuron/timecheck
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?