Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SAM agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
SAM agent
Commits
b86ace69
Commit
b86ace69
authored
1 month ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
v0.2 - handle a deb file directly
parent
f7a749bc
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+10
-1
10 additions, 1 deletion
README.md
config.sh.dist
+4
-1
4 additions, 1 deletion
config.sh.dist
installer_samagent.sh
+33
-23
33 additions, 23 deletions
installer_samagent.sh
with
47 additions
and
25 deletions
README.md
+
10
−
1
View file @
b86ace69
...
...
@@ -3,7 +3,7 @@
## Description
This is an installer for Linux.
*
It extracts the debian 64 package
*
It extracts the debian 64 package
from
*
Its files will be moved to /opt/snow/ and
*
the pre install and post install script will be executed.
...
...
@@ -40,6 +40,15 @@ In the config.sh you can make your changes
*
Watch the PDF file and search for the correct sitename for your institution.
*
Set your sitename in the line
`SITENAME="unibe..."`
## Get the DEB package
Put the amd64 DEB package into ~/Downloads/.
In config.sh set
```
shell
DEBFILE
=
~/Downloads/04788015-Lin_C_V2-snowagent-7.0.1-x64.deb
```
## Install
Start
`./installer_samagent.sh`
This diff is collapsed.
Click to expand it.
config.sh.dist
+
4
−
1
View file @
b86ace69
...
...
@@ -9,10 +9,13 @@ PLATFORM="amd64"
# source file in download folder
SOURCEZIP=~/Downloads/SAM\ Agent.zip
# or better: filename of deb file
DEBFILE=~/Downloads/04788015-Lin_C_V2-snowagent-7.0.1-x64.deb
# temp dir to extract package before installing
EXTRACTDIR=/tmp/SAM_AGENT.tmp
# target dir
# target dir
- a subdir "snow" will be created
INSTALLDIR=/opt
URLSITENAMNE=https://sam.intern.unibe.ch/e1498122/e1502084/SiteName_Uebersicht.pdf
...
...
This diff is collapsed.
Click to expand it.
installer_samagent.sh
+
33
−
23
View file @
b86ace69
...
...
@@ -7,9 +7,10 @@
#
# ----------------------------------------------------------------------
# 2024-04-19 v0.1 <axel.hahn@unibe.ch>
# 2024-05-22 v0.2 <axel.hahn@unibe.ch> handle deb file directly
# ======================================================================
_version
=
"0.
1
"
_version
=
"0.
2
"
# ----------------------------------------------------------------------
# FUNCTIONS
...
...
@@ -46,7 +47,7 @@ if [ -z "$SITENAME" ]; then
exit
1
fi
if
[
-z
"
$DEBFILE
"
]
;
then
echo
"Source file:
$SOURCEZIP
"
ls
-l
"
$SOURCEZIP
"
||
exit
1
...
...
@@ -54,6 +55,7 @@ h2 "Detect DEB package for ${PLATFORM} from $SOURCEZIP ..."
DEBFILE
=
$(
unzip
-l
"
$SOURCEZIP
"
"SAM Agent/*
${
PLATFORM
}
.deb"
|
grep
-v
"/._"
|
grep
"
${
PLATFORM
}
"
| rev |
cut
-f
1,2
-d
" "
| rev
)
echo
"Found debian file:
$DEBFILE
"
test
-z
"
$DEBFILE
"
&&
echo
"Debian Paket nicht gefunden. Paket korrupt oder Skript findet es nicht."
test
-z
"
$DEBFILE
"
&&
exit
2
echo
"OK"
...
...
@@ -68,6 +70,11 @@ pwd
h2
"Extracting
$DEBFILE
from
$SOURCEZIP
..."
unzip
-o
"
$SOURCEZIP
"
-d
.
"
$DEBFILE
"
||
exit
4
echo
"Result:"
else
test
-d
"
$EXTRACTDIR
"
||
mkdir
"
$EXTRACTDIR
"
cd
"
$EXTRACTDIR
"
||
exit
3
fi
ls
-l
"
$DEBFILE
"
||
exit
5
...
...
@@ -90,7 +97,7 @@ echo "Found subdir: opt/$subdirname"
h2
"Get version ..."
PKGVERSION
=
$(
grep
"^Version: "
"control"
|
cut
-f
2-
-d
" "
)
PKGVERSION
=
$(
grep
"^Version: "
"control"
2>/dev/null
|
cut
-f
2-
-d
" "
)
SWVERSION
=
$(
grep
"^Version: "
"
$INSTALLDIR
/
$subdirname
/control"
|
cut
-f
2-
-d
" "
)
echo
"To install:
$PKGVERSION
"
echo
"Installed :
$SWVERSION
"
...
...
@@ -113,23 +120,26 @@ else
h2
"Put files to opt ..."
test
-d
"
$INSTALLDIR
/
$subdirname
"
&&
(
echo
"Removing
$INSTALLDIR
/
$subdirname
"
;
sudo rm
-rf
"
$INSTALLDIR
/
$subdirname
"
)
echo
"Copy opt/
$subdirname
to
$INSTALLDIR
"
echo
"Copy opt/
$subdirname
to
$INSTALLDIR
...
"
sudo cp
-r
"opt/
$subdirname
"
"
$INSTALLDIR
"
||
exit
6
sudo cp
"control"
"
$INSTALLDIR
/
$subdirname
"
||
exit
6
echo
echo
"Result"
sudo
find
$INSTALLDIR
/
$subdirname
h2
"Run debian scripts ..."
for
myscript
in
preinst postinst
# prerm postrm
do
echo
"-----
$myscript
$PKGNAME
"
sudo
./
$myscript
"
$PKGNAME
"
||
exit
7
echo
"----- Executing '
$myscript
$PKGNAME
'"
sudo
./
$myscript
"
$PKGNAME
"
||
(
echo
;
read
-p
"--> Exitcode was non zero. Press RETURN to continue or Ctrl+C to abort"
)
echo
done
fi
h2
"Cleanup ..."
echo
"Deleting workdir
$EXTRACTDIR
..."
#
rm -rf "$EXTRACTDIR"
rm
-rf
"
$EXTRACTDIR
"
echo
echo
"Done."
...
...
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