Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
labmanager-systemd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto LIVIO BECCARIA
labmanager-systemd
Commits
920fc78d
Commit
920fc78d
authored
2 years ago
by
Alberto LIVIO BECCARIA
Browse files
Options
Downloads
Patches
Plain Diff
Considera l'id dell'esame per decidere se pulire l'area o no
parent
0d9991e6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin-ubuntu/get-config
+21
-4
21 additions, 4 deletions
bin-ubuntu/get-config
with
21 additions
and
4 deletions
bin-ubuntu/get-config
+
21
−
4
View file @
920fc78d
...
...
@@ -103,6 +103,7 @@ getConfigVars() {
MACHINE_ID
=
`
echo
$MACHINE_JSON
| jsonValue
id
1
`
MACHINE_CONFIGS_ID
=
`
echo
$MACHINE_JSON
| jsonValue configs_id 1
`
CONFIG_NAME
=
`
echo
$MACHINE_JSON
| jsonValue name 2
`
EXAM_ID
=
`
echo
$MACHINE_JSON
| jsonValue examid 1
`
if
[[
"
$CONFIG_NAME
"
==
""
]]
;
then
echo
"Error fetching machine configuration!"
...
...
@@ -223,6 +224,7 @@ start() {
rm
/local/iptables
>
/dev/null 2>&1
rm
/local/iptables.prev
>
/dev/null 2>&1
rm
/local/mk-homedir
>
/dev/null 2>&1
rm
/local/examid
>
/dev/null 2>&1
/usr/bin/systemctl start graphical
&&
exit
0
fi
echo
"Fatal error(s): missing or wrong web service reply, abort."
...
...
@@ -238,13 +240,13 @@ start() {
echo
"Reboot to Normal!"
# reboot => exam
else
echo
"Reboot to Exam
!
"
echo
"Reboot to Exam
(exam id:
${
EXAM_ID
}
)
"
fi
/usr/bin/systemctl reboot
fi
else
# at boot time
if
[[
"
$CONFIG_NAME
"
!=
"
$CONFIG_NAME_PREV
"
]]
;
then
#
if [[ "$CONFIG_NAME" != "$CONFIG_NAME_PREV" ]]; then
# update config_name file
echo
"
${
CONFIG_NAME
}
"
>
/local/config_name
...
...
@@ -256,10 +258,25 @@ start() {
rm
/local/iptables
>
/dev/null 2>&1
rm
/local/iptables.prev
>
/dev/null 2>&1
rm
/local/mk-homedir
>
/dev/null 2>&1
rm
/local/examid
>
/dev/null 2>&1
else
touch
/local/mk-homedir
# if the examid of the session before the boot is different,
# then clean the exam user home (if the profile requires it)
EXAM_ID_PREV
=
""
# if the exam is already started, get examid from file
if
[[
-f
/local/examid
]]
;
then
EXAM_ID_PREV
=
`
cat
/local/examid
`
# otherwise let's create the file with the current examid
else
echo
"
${
EXAM_ID
}
"
>
/local/examid
fi
# different examid?
if
[[
${
EXAM_ID
}
!=
${
EXAM_ID_PREV
}
]]
;
then
touch
/local/mk-homedir
fi
fi
fi
#
fi
# choose the correct target
# we have just booted/rebooted, update the current configuration via web service
updateCurrentConfigId
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment