summaryrefslogtreecommitdiffstats
path: root/firstaidkit-qs
blob: ab80935f5b5bc453cdb08dd4365837070772de83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

function pause()
{
  echo "Press enter to continue"
  read a
}

if [ "$DISPLAY" == "" ]; then
  DIALOG="dialog"
else
  DIALOG="dialog"
fi

OPTION=""
TMPFILE="/tmp/$0-$$.item"
TITLE="First Aid Kit quickstart menu"

WIDTH="45"
HEIGHT="15"
MENUHEIGHT="12"

#while [ "x$OPTION" == "x" ]; do
  $DIALOG --menu "$TITLE" "$HEIGHT" "$WIDTH" "$MENUHEIGHT" shell "Start shell" fakd "Run diagnostic" reboot "Reboot"  2>$TMPFILE
  OPTION=$(cat $TMPFILE)

  if [ "x$OPTION" == "xshell" ]; then
    echo "Starting shell..."
    bash
  elif [ "x$OPTION" == "xfakd" ]; then
    echo "Running diagnostic..."
    firstaidkit -a
    pause
  elif [ "x$OPTION" == "xreboot" ]; then
    reboot
  fi

#done