source: src-sh/pc-fbsdupdatecheck/main.c @ d47ba25

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since d47ba25 was d47ba25, checked in by Kris Moore <kris@…>, 11 months ago

Fix an issue with pc-fbsdupdatecheck and the Updater GUI

  • Property mode set to 100644
File size: 820 bytes
Line 
1#include <sys/types.h>
2#include <sys/fcntl.h>
3#include <err.h>
4#include <stdlib.h>
5#include <stdio.h>
6#include <string.h>
7#include <unistd.h>
8
9int main(int argc, char ** argv)
10{
11  if ( argc == 2 ) {
12    if ( strcmp(argv[1], "update") != 0 )
13    {
14       printf("Invalid option!");
15       return 1;
16    }
17    // Fetch to the standard working-dir
18    system("touch /tmp/.fbsdup-lock");
19    system("cat /usr/sbin/freebsd-update | sed 's|! -t 0|-z '1'|g' | /bin/sh -s 'fetch'");
20    system("rm /tmp/.fbsdup-lock");
21    return 0;
22  } else {
23    system("touch /tmp/.fbsdup-lock");
24    system("mkdir /var/db/freebsd-update-check 2>/dev/null");
25    system("cat /usr/sbin/freebsd-update | sed 's|! -t 0|-z '1'|g' | /bin/sh -s 'fetch' '-d' '/var/db/freebsd-update-check'");
26    system("rm /tmp/.fbsdup-lock");
27    return 0;
28  }
29}
Note: See TracBrowser for help on using the repository browser.