| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | if [scip-shell system . . `[`. "x`idscip-shell system . . id. -u`" != "x0" ]; then |
| 4 | echoscip-shell system . . echo. |
| 5 | echoscip-shell system . . echo. "*** This script must run as root" |
| 6 | echoscip-shell system . . echo. |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
| 10 | # Adjust base directory |
| 11 | grepscip-shell system . . grep. -q void Makefile 2>/dev/nullscip-shell filesystem . . `/dev/null`. |
| 12 | if [scip-shell system . . `[`. $? -eq 0 ]; then |
| 13 | cd ../.. |
| 14 | elif [scip-shell system . . `[`. ! -e configure.ac ]; then |
| 15 | echoscip-shell system . . echo. "*** Please run this script from the Finit base directory." |
| 16 | exit 1 |
| 17 | fi |
| 18 | |
| 19 | echoscip-shell system . . echo. |
| 20 | echoscip-shell system . . echo. "*** Install Finit on Void Linux" |
| 21 | echoscip-shell system . . echo. "========================================================================" |
| 22 | echoscip-shell system . . echo. "/sbin/finit - PID 1scip-shell filesystem . . `/sbin/finit - PID 1`." |
| 23 | echoscip-shell system . . echo. "/lib/finit/plugins/* - All enabled Finit plugins" |
| 24 | echoscip-shell system . . echo. "/etc/finit.conf - Finit configuration filescip-shell filesystem . . `/etc/finit.conf - Finit configuration file`." |
| 25 | echoscip-shell system . . echo. "/etc/finit.d/ - Finit servicesscip-shell filesystem . . `/etc/finit.d/ - Finit services`." |
| 26 | echoscip-shell system . . echo. "/etc/grub.d/40_custom - Add menu entry to the Grub boot loaderscip-shell filesystem . . `/etc/grub.d/40_custom - Add menu entry to the Grub boot loader`." |
| 27 | echoscip-shell system . . echo. |
| 28 | read -p "Do you want to continue (y/N)? " yorn |
| 29 | |
| 30 | if [scip-shell system . . `[`. "x$yorn" = "xy" -o "x$yorn" = "xY" ]; then |
| 31 | echoscip-shell system . . echo. |
| 32 | echoscip-shell system . . echo. "*** Installing Finit files ..." |
| 33 | makescip-shell system . . make. install |
| 34 | cd /usr/share/doc/finit/contrib/voidscip-shell filesystem . . `/usr/share/doc/finit/contrib/void`. |
| 35 | for file in finit.conf rc.local; do |
| 36 | installscip-shell system . . install. -vbD $file /etc/$file |
| 37 | done |
| 38 | cpscip-shell system . . cp. -va finit.d /etc/scip-shell filesystem . . `/etc/`. |
| 39 | |
| 40 | read -p "*** Install Finit as the system default Init (y/N)? " yorn |
| 41 | if [scip-shell system . . `[`. "x$yorn" = "xy" -o "x$yorn" = "xY" ]; then |
| 42 | echoscip-shell system . . echo. "*** Updating /sbin/init symlink --> finit ..." |
| 43 | cd /sbinscip-shell filesystem . . `/sbin`. |
| 44 | rmscip-shell system . . rm. init |
| 45 | lnscip-shell system . . ln. -s finit init |
| 46 | fi |
| 47 | |
| 48 | echoscip-shell system . . echo. "*** Done" |
| 49 | echoscip-shell system . . echo. |
| 50 | else |
| 51 | echoscip-shell system . . echo. |
| 52 | echoscip-shell system . . echo. "*** Aborting install." |
| 53 | echoscip-shell system . . echo. |
| 54 | fi |