File: newProfile.sh

package info (click to toggle)
golang-github-zmap-zlint 3.6.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,008 kB
  • sloc: sh: 162; makefile: 38
file content (30 lines) | stat: -rwxr-xr-x 534 bytes parent folder | download
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
# Script to create new profile from template

USAGE="Usage: $0 <ARG1>

ARG1: file_name"

if [ $# -eq 0 ]; then
    echo "No arguments provided..."
    echo "$USAGE"
    exit 1
fi

if [ ! -d profiles ]
then
   echo "Directory 'profiles' does not exist. Can't make new file."
   exit 1
fi


if [ -e profiles/profile_$1.go ]
then
   echo "File already exists. Can't make new file."
   exit 1
fi

PROFILE=$1

sed -e "s/PROFILE/${PROFILE}/" profileTemplate > profiles/profile_${PROFILE}.go

echo "Created file profiles/lint_${PROFILE}.go"