![]() |
|
Code Schnipsel - PRIMARY_VOLUME - Druckversion +- Synology Projekte (https://source.synology.me/mybb) +-- Forum: Synology (https://source.synology.me/mybb/forumdisplay.php?fid=3) +--- Forum: SPK (https://source.synology.me/mybb/forumdisplay.php?fid=9) +--- Thema: Code Schnipsel - PRIMARY_VOLUME (/showthread.php?tid=207) |
Code Schnipsel - PRIMARY_VOLUME - admin - 23.06.2024 Hier ein Beispiel wie man herausfindet, welches Volume aktuell das Installationsvolume ist. Dazu kann man die Datei synoinfo.conf auslesen und prüfen was hinter dem Eintrag pkg_def_intall_vol steht. Hat man nur ein Volume, wird in der Datei nix eingetragen und man kann davon ausgehen das das PRIMARY_VOLUME="/volume1" gilt. Code: #Volume bestimmen
if grep -q pkg_def_intall_vol "/etc/synoinfo.conf"; then
PRIMARY_VOLUME=$(grep -o 'pkg_def_intall_vol=".\{8\}' /etc/synoinfo.conf | sed 's/pkg_def_intall_vol="\(.\{8\}\)/\1/')
else
PRIMARY_VOLUME="/volume1"
fiGruß - Der Admin |