| 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. "=> Unfortunately this script must run as root (sudo) <=" |
| 6 | echoscip-shell system . . echo. |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
| 10 | # Adjust base directory |
| 11 | grepscip-shell system . . grep. -q debian 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 Debian GNU/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/10_linux - Add Finit to Grub's SUPPORTED_INITSscip-shell filesystem . . `/etc/grub.d/10_linux - Add Finit to Grub's SUPPORTED_INITS`." |
| 27 | echoscip-shell system . . echo. |
| 28 | read -p "Do you want to continue (y/N)? " yorn |
| 29 | echoscip-shell system . . echo. |
| 30 | |
| 31 | if [scip-shell system . . `[`. "x$yorn" = "xy" -o "x$yorn" = "xY" ]; then |
| 32 | echoscip-shell system . . echo. "Installing Finit files ..." |
| 33 | makescip-shell system . . make. install |
| 34 | cd /usr/share/doc/finit/contrib/debianscip-shell filesystem . . `/usr/share/doc/finit/contrib/debian`. |
| 35 | for file in finit.conf; 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 | echoscip-shell system . . echo. "*** Setting up a GRUB boot entry ..." |
| 41 | fn=/etc/grub.d/10_linuxscip-shell filesystem . . `/etc/grub.d/10_linux`. |
| 42 | if [scip-shell system . . `[`. -e $fn ]; then |
| 43 | if `grepscip-shell system . . grep. SUPPORTED_INITS $fn |headscip-shell system . . head. -1 |grepscip-shell system . . grep. -q finit`; then |
| 44 | echoscip-shell system . . echo. "Already installed, done." |
| 45 | else |
| 46 | echoscip-shell system . . echo. "Adding Finit to list of SUPPORTED_INITS ..." |
| 47 | sedscip-shell system . . sed. -i 's/SUPPORTED_INITS="[^"]*/& finit:\/sbin\/finit/' $fn |
| 48 | update-grub |
| 49 | fi |
| 50 | else |
| 51 | echoscip-shell system . . echo. "Cannot find $fn, you'll have to set up your bootloader on your own." |
| 52 | fi |
| 53 | |
| 54 | echoscip-shell system . . echo. |
| 55 | echoscip-shell system . . echo. "*** Done" |
| 56 | echoscip-shell system . . echo. |
| 57 | else |
| 58 | echoscip-shell system . . echo. |
| 59 | echoscip-shell system . . echo. "*** Aborting install." |
| 60 | echoscip-shell system . . echo. |
| 61 | fi |