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
7f5bf304
Commit
7f5bf304
authored
2 years ago
by
Alberto LIVIO BECCARIA
Browse files
Options
Downloads
Patches
Plain Diff
Installa anche l'override di USBGuard
parent
499e7924
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
install-labmanager-ubuntu.sh
+31
-12
31 additions, 12 deletions
install-labmanager-ubuntu.sh
with
31 additions
and
12 deletions
install-labmanager-ubuntu.sh
+
31
−
12
View file @
7f5bf304
#!/
bin/
bash
#!/
usr/bin/env
bash
# LabManager: systemd units & scripts installer v2.0
GIT_URL
=
https://gitlab.di.unipmn.it
GIT_BASE_DIR
=
ulisse/labmanager-systemd/raw
...
...
@@ -16,6 +16,10 @@ SYSTEMD_FILES=(
"esamesync-esame.service"
"esame-get-config.timer"
"esame-configurator.target"
"esame.target"
"esamekiosk.target"
"esameshow.target"
"esame-multi-user.target"
)
USBGUARD_OVERRIDE_FILES
=(
"usbguard.service.d/override.conf"
)
SYSCONFIG_FILES
=(
"labmanager"
"esamesync-esame"
...
...
@@ -46,6 +50,7 @@ OLD_FILES=(
"/etc/systemd/system/esame.target"
"/etc/systemd/system/esamekiosk.target"
"/etc/systemd/system/esameshow.target"
"/etc/systemd/system/usbguard.service.d"
)
# DON'T TOUCH UNDER THIS LINE! #################################################
...
...
@@ -75,7 +80,7 @@ myuseradd() {
fi
}
function
removeFiles
{
removeFiles
()
{
local
files
=(
"
$@
"
)
for
f
in
"
${
files
[@]
}
"
...
...
@@ -85,7 +90,7 @@ function removeFiles {
done
}
function
downloadFiles
{
downloadFiles
()
{
local
base_url
=
"
$1
"
shift
local
files
=(
"
$@
"
)
...
...
@@ -124,7 +129,9 @@ then
exit
1
fi
# remove obsolete files
GIT_BRANCH_PATH
=
${
GIT_URL
}
/
${
GIT_BASE_DIR
}
/
${
GIT_BRANCH
}
# Remove obsolete files
echo
-e
"
\e
[1mRemoving obsolete files...
\e
[0m"
removeFiles
${
OLD_FILES
[@]
}
echo
...
...
@@ -148,13 +155,13 @@ mkdir -p /usr/libexec/labmanager
echo
echo
#
script per i servizi systemd
#
Systemd services scripts
echo
-e
"
\e
[1mDownloading systemd script files...
\e
[0m"
cd
/usr/libexec/labmanager
echo
"Creating symlink bta-no-usbpen -> /bin/sleep..."
ln
-s
-f
/bin/sleep bta-no-usbpen
echo
downloadFiles
"
$
GIT_URL
/
$GIT_BASE_DIR
/
$
GIT_BRANCH
/bin-ubuntu"
${
BIN_FILES
[@]
}
downloadFiles
"
$
{
GIT_BRANCH
_PATH
}
/bin-ubuntu"
${
BIN_FILES
[@]
}
chmod
+x
*
echo
echo
...
...
@@ -167,22 +174,32 @@ for conffile in ${SYSCONFIG_FILES[@]}; do
if
[
-e
"
${
conffile
}
"
]
;
then
echo
"Not overwriting existing file
${
conffile
}
, skipping it."
else
downloadFiles
"
$
GIT_URL
/
$GIT_BASE_DIR
/
$
GIT_BRANCH
/sysconfig"
"
${
conffile
}
"
downloadFiles
"
$
{
GIT_BRANCH
_PATH
}
/sysconfig"
"
${
conffile
}
"
fi
done
echo
echo
#
servizi systemd
#
Systemd services files
echo
-e
"
\e
[1mDownloading systemd unit files...
\e
[0m"
cd
/etc/systemd/system
downloadFiles
"
$GIT_URL
/
$GIT_BASE_DIR
/
$GIT_BRANCH
/systemd-ubuntu"
${
SYSTEMD_FILES
[@]
}
downloadFiles
"
${
GIT_BRANCH_PATH
}
/systemd-ubuntu"
${
SYSTEMD_FILES
[@]
}
echo
echo
# Override USBGuard
echo
-e
"
\e
[1mOverriding USBGuard systemd service...
\e
[0m"
mkdir
/etc/systemd/system/usbguard.service.d
cd
/etc/systemd/system/usbguard.service.d
downloadFiles
"
${
GIT_BRANCH_PATH
}
/systemd-ubuntu"
${
USBGUARD_OVERRIDE_FILES
[@]
}
echo
echo
#
f
ollowing links should not be needed, specifying services as "Wants" directives should suffice
#
F
ollowing links should not be needed, specifying services as "Wants" directives should suffice
# create symlinks for target esame, esamekiosk, esameshow and esame-configurator
# Create symlinks for target esame, esamekiosk, esameshow and esame-configurator
echo
-e
"
\e
[1mSetting up targets & services...
\e
[0m"
cd
/etc/systemd/system
mkdir
esame.target.wants
cd
esame.target.wants
ln
-s
/usr/lib/systemd/system/accounts-daemon.service
.
...
...
@@ -216,7 +233,9 @@ cd ..
mkdir
esame-configurator.target.wants
cd
esame-configurator.target.wants
ln
-s
/etc/systemd/system/enable-wol@.service enable-wol@eth0.service
cd..
cd
..
echo
echo
echo
-e
"
\e
[1mReload systemd...
\e
[0m"
systemctl daemon-reload
...
...
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