-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.sh
More file actions
46 lines (37 loc) · 1.25 KB
/
template.sh
File metadata and controls
46 lines (37 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/zsh
#
# Version: 1.0
# Name:
# Author:
# Created:
# Updated:
# Description: -
# -
# -
# -
#
# Copyright (c) 2023 Apfelwerk Apfelwerk GmbH & Co. KG
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Logging function and variables for this script
# Variables for the logging function
scriptName=$(basename "${0}" | tr -d " ")
logDir="/Library/Logs/Management"
logFile="${logDir}/$(echo "${scriptName}" | cut -d . -f1).log"
# Creating Log file directory
if [[ ! -d "${logDir}" ]]
then
mkdir -p "${logDir}"
fi
# Logging function for this script. to use it, just call 'log "your message"' in your script
logd() {
echo "$(date "+%Y-%m-%d %H:%M:%S")" "[${scriptName}]: ${*}" >> "${logFile}"
}
logd "$(printf "%0.s# " {1..10}) "Starting ${scriptName} script "$(printf "%0.s# " {1..10})"
# Code for this script goes here below this line
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Variables for the application part of this script
uid=$(id -u "$loggedInUser")
# Start code here for the application part of this script
# End of code for this script
logd "$(printf "%0.s# " {1..10}) "Finished ${scriptName} script "$(printf "%0.s# " {1..10})"
exit 0