-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialize
More file actions
executable file
·83 lines (77 loc) · 1.9 KB
/
Copy pathinitialize
File metadata and controls
executable file
·83 lines (77 loc) · 1.9 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
flag=1
while [ $flag -eq 1 ]
do
clear
echo "Manage your Repository"
echo "[0] Set Title [1] Manage Authors [2] Set Group [3] Set Language [4] Exit"
read choice
if ! [ -f config.txt ]
then
echo -e "Title:" > config.txt
echo -e "Group:" >> config.txt
fi
if [ $choice -eq 0 ]
then
echo "Set Title:"
read title
sed -i "s/Title:.*\$/Title:$title/g" config.txt
elif [ $choice -eq 1 ]
then
echo "The following Authors are known:"
grep -o "Name: .*\$" config.txt
echo
echo "[0] Add Author [1] Edit Author [2] Delete Author"
read choice
if [ $choice -eq 0 ]
then
echo "Name:"
read name
echo "Student Number:"
read studentNumber
echo -e "Name: $name StudentNumber: $studentNumber" >> config.txt
elif [ $choice -eq 1 ]
then
echo "Enter name of the Author:"
read name
echo "Enter a new Name:"
read newName
echo "Enter a new Student Number:"
read studentNumber
sed -i "s/Name: $name .*\$/Name: $newName StudentNumber: $studentNumber/g" config.txt
elif [ $choice -eq 2 ]
then
echo "Enter name of the Author:"
read name
sed -i "/Name: $name .*\$/d" config.txt
fi
elif [ $choice -eq 2 ]
then
echo "Set Group: (e.g: \"Group 14 (Tutorname)\"):"
read group
sed -i "s/Group:.*\$/Group:$group/g" config.txt
elif [ $choice -eq 3 ]
then
echo "[0] English [1] German"
read choice
if [ $choice -eq 0 ]
then
sed -i "s/Übungsblatt/Assignment/g" styles/preamble.tex template/main/main.tex
sed -i "s;\\\\usepackage\[ngerman\];% \\\\usepackage\[ngerman\];g" styles/packages.tex
elif [ $choice -eq 1 ]
then
sed -i "s/Assignment/Übungsblatt/g" styles/preamble.tex template/main/main.tex
sed -i "s;% \\\\usepackage\[ngerman\];\\\\usepackage\[ngerman\];g" styles/packages.tex
else
echo "Invalid input! Exiting..."
flag=0
fi
elif [ $choice -eq 4 ]
then
echo "Exiting..."
flag=0
else
echo "Invalid input! Exiting..."
flag=0
fi
done