Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * BSDBOX installer Program
- * The BSDBox Project By: Gary & Vincent
- * Nov. 2015
- *
- */
- #include <ncurses.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <sys/utsname.h>
- #include <unistd.h>
- #include <string.h>
- #include <errno.h>
- #include <sys/wait.h>
- #include <sys/sysctl.h>
- #define RED "\x1b[31m" // Colours for the logo to make it pretty!
- #define GREEN "\x1b[32m"
- #define BLUE "\x1b[34m"
- #define RESET "\x1b[0m"
- /* BSDBOX logo created by me, I use block characters */
- void print_logo(){
- printf(RED"╔═══════════════════════════════════════════════════════════════════╗\n");
- printf(RED"║ ▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄ ▄▄▄▄ "RED"║\n");
- printf(RED"║ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄▄ "RED" ║\n");
- printf(RED"║ ▄▄ ▄▄▄ ▄▄ ▄▄▄ ▄▄▄▄ ▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄ ▄ "RED" ║\n");
- printf(RED"║ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄ ▄▄ "RED" ║\n");
- printf(RED"║ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄ ▄▄ "RED" ║\n");
- printf(RED"║ ▄▄ ▄▄▄ ▄▄ ▄▄▄ ▄▄▄▄ ▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄ ▄ "RED" ║\n");
- printf(RED"║ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄▄ "RED" ║\n");
- printf(RED"║ ▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄ ▄▄▄▄"RED" ║\n");
- printf(RED"║"GREEN" Install v0.1"RED" ║\n");
- printf(RED"╚═══════════════════════════════════════════════════════════════════╝"RESET"\n");
- }
- /* This function does pkg install and all the packages you need for the Skel */
- void pkg_inst(){
- printf("\n\n");
- printf(BLUE"This is the Default Base Packages for BSDBox X11 + Openbox & tools, and extra useful packages.\n");
- printf("\n\n");
- printf(RED"PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
- getchar();
- printf("\n\n");
- char *argv[] = {
- "pkg", "install",
- "xorg",
- "openbox",
- "obconf",
- "obkey",
- "obmenu",
- "dmenu",
- "compton",
- "bmpanel2",
- "geany",
- "vim",
- "irssi",
- "firefox",
- "smplayer",
- "openshot",
- "pcmanfm",
- "lxappearance",
- "gimp",
- "sudo",
- "gksu",
- "nitrogen",
- "lxmusic",
- "ppsspp",
- "rxvt-unicode",
- "bash",
- "mc",
- "tmux",
- "scrot",
- "gtk-murrine-engine",
- "webcamd",
- "pwcview",
- "engrampa",
- "eggdrop",
- "tdom",
- "nano",
- "plank",
- 0,
- };
- pid_t pid = fork();
- if(pid == 0) {
- execv("/usr/sbin/pkg", argv);
- }
- else {
- waitpid(pid, NULL, 0);
- }
- }
- /* This function will extract the Skel Gunzip Config to the $home <DIR> */
- void skel_extract(){
- printf("\n\n");
- printf(BLUE"Now lets unextract the SKEL configs for BSDBox.\n");
- printf("\n\n");
- printf(RED"PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
- getchar();
- printf("\n\n");
- char buf[256];
- sprintf(buf, "/usr/home/%s", getlogin());
- char *argv[] = {
- "tar", "-xvzf",
- "bsdbox-skel.tar.gz",
- "-C",
- buf,
- 0,
- };
- pid_t pid = fork();
- if(pid == 0) {
- execv("/usr/bin/tar", argv);
- }
- else {
- waitpid(pid, NULL, 0);
- }
- }
- /* This function just thank you for trying out the project ;) */
- void thank_you(){
- printf("\n\n");
- printf(RED"Thank You for trying out "BLUE"BSDBox"RED"!"RESET"\n");
- printf("\n\n");
- }
- int main(){
- print_logo();
- pkg_inst();
- skel_extract();
- thank_you();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment