Skip to content

Commit 2f79c39

Browse files
marvinhinzCarterLi
andauthored
OS (Linux): adds support for proxmox backup server detection (#2443)
* add support for proxmox backup server detection * Update Proxmox identifiers and pretty names * Simplify Proxmox logo names in p.inc --------- Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
1 parent 44056f1 commit 2f79c39

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

src/detection/os/os_linux.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ FF_A_UNUSED static bool detectDebianDerived(FFOSResult* result) {
208208
ffStrbufSetStatic(&result->idLike, "debian");
209209
return true;
210210
} else if (access("/usr/bin/pveversion", X_OK) == 0) {
211-
ffStrbufSetStatic(&result->id, "pve");
211+
ffStrbufSetStatic(&result->id, "proxmox");
212212
ffStrbufSetStatic(&result->idLike, "debian");
213213
ffStrbufSetStatic(&result->name, "Proxmox VE");
214214
ffStrbufClear(&result->versionID);
@@ -220,8 +220,30 @@ FF_A_UNUSED static bool detectDebianDerived(FFOSResult* result) {
220220
NULL,
221221
}) == NULL) { // 8.2.2
222222
ffStrbufTrimRightSpace(&result->versionID);
223+
ffStrbufSetStatic(&result->prettyName, "Proxmox VE ");
224+
ffStrbufAppend(&result->prettyName, &result->versionID);
225+
} else {
226+
ffStrbufSetStatic(&result->prettyName, "Proxmox VE");
227+
}
228+
return true;
229+
} else if (access("/usr/sbin/proxmox-backup-manager", X_OK) == 0) {
230+
ffStrbufSetStatic(&result->id, "proxmox");
231+
ffStrbufSetStatic(&result->idLike, "debian");
232+
ffStrbufSetStatic(&result->name, "Proxmox Backup Server");
233+
ffStrbufClear(&result->versionID);
234+
if (ffProcessAppendStdOut(&result->versionID, (char* const[]) {
235+
"/usr/bin/dpkg-query",
236+
"--showformat=${version}",
237+
"--show",
238+
"proxmox-backup-server",
239+
NULL,
240+
}) == NULL) {
241+
ffStrbufTrimRightSpace(&result->versionID);
242+
ffStrbufSetStatic(&result->prettyName, "Proxmox Backup Server ");
243+
ffStrbufAppend(&result->prettyName, &result->versionID);
244+
} else {
245+
ffStrbufSetStatic(&result->prettyName, "Proxmox Backup Server");
223246
}
224-
ffStrbufSetF(&result->prettyName, "Proxmox VE %s", result->versionID.chars);
225247
return true;
226248
} else if (ffPathExists("/etc/rpi-issue", FF_PATHTYPE_FILE)) {
227249
// Raspberry Pi OS

src/logo/ascii/p.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static const FFlogo P[] = {
311311
#ifdef FASTFETCH_DATATEXT_LOGO_PROXMOX
312312
// Proxmox
313313
{
314-
.names = { "Proxmox", "pve" },
314+
.names = { "Proxmox" },
315315
.lines = FASTFETCH_DATATEXT_LOGO_PROXMOX,
316316
.colors = {
317317
FF_COLOR_FG_WHITE,

0 commit comments

Comments
 (0)