Utoljára aktív 1 day ago

Revízió 66d4c2066ce3c35fe4a192b98c6a216d1729f0ba

ics214-logger.sh Eredeti
1#!/usr/bin/env sh
2# Create parseable data for the Winlink Activity Log (ICS 214)
3# You can paste the output of this script within the ICS 214 Winlink Form
4# Use `Paste Data from a Spreadsheet` in the ICS 214 form
5#
6# Author: Dominic Reich "OE7DRT" <quick.hat4396@qtztsjosmprqmgtunjyf.com>
7# Created: 2026-03-07
8#
9# Changelog
10# 2026-03-08
11# Added copy to clipboard on exit (forgot that before)
12#
13# LICENSE: MIT
14#
15# Copyright © 2026 Dominic Reich, OE7DRT
16#
17# Permission is hereby granted, free of charge, to any person obtaining a copy
18# of this software and associated documentation files (the “Software”), to deal
19# in the Software without restriction, including without limitation the rights
20# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21# copies of the Software, and to permit persons to whom the Software is
22# furnished to do so, subject to the following conditions:
23#
24# The above copyright notice and this permission notice shall be included in
25# all copies or substantial portions of the Software.
26#
27# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33# SOFTWARE.
34
35trap process 2
36
37process()
38{
39 if [ -z "${mylist}" ]; then
40 echo -en 2>&1 "\n\nList is empty, aborting!\n"
41 exit 0
42 fi
43
44 cutline="--- 8< --- cut --- 8< --- cut --- 8< ---"
45 echo -en "\n\n${cutline}\n\n${mylist}\n${cutline}\n"
46
47 command -v wl-copy >/dev/null 2>&1 && { echo -en "${mylist}" | wl-copy -n; echo -en "\nThe list has also been copied to the clipboard\n"; }
48
49 exit 0
50}
51
52mylist=""
53counter=1
54
55echo -en "This scipt gathers activity tasks used for the Winlink Activity Log (ICS 214)
56The numbered activities represent the current line number
57The actual time will be added as soon as you hit the enter key\n
58Press <CTRL>+C to stop and show the log\n\n"
59
60while :
61do
62 if [ -n "${mylist}" ]; then
63 echo -en "\nActivities so far:\n${mylist}\n"
64 fi
65
66 echo -en "${counter}. activity: "
67 read
68
69 mylist+="$(date +"""%Y-%m-%d %H:%M""")\t${REPLY}\n"
70
71 ((counter++))
72done
73