tpf-setup 1.52 KB
Newer Older
1
#!/bin/bash
Roman Haefeli's avatar
Roman Haefeli committed
2

Roman Haefeli's avatar
Roman Haefeli committed
3
4
5
6
7
if [ "$1" == "--do-nothing" ]
then
  exit 0
fi

Roman Haefeli's avatar
Roman Haefeli committed
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# At this point mtr should be installed and thus if we don't find
# it means that /usr/local/sbin is not part of PATH
if ! echo $PATH | grep -q "/usr/local/sbin"
then
  read -p "Add /usr/local/sbin to your PATH? Y/n " -r
  if [[ ! $REPLY =~ ^[Nn]$ ]]
  then
    echo "export PATH=/usr/local/sbin:$PATH" >> ~/.bash_profile
    echo "export PATH=/usr/local/sbin:$PATH"
  fi
fi

# Install qjackctl configuration
read -p "Write qjackctl configuration file? Y/n " -r
if [[ ! $REPLY =~ ^[Nn]$ ]]
then
  qjconffile=~/Library/Preferences/org.rncbc.QjackCtl.plist
  if [ -f $qjconffile ]
  then
    read -p "Overwrite existing qjackctl configuration file? Y/n " -r
    if [[ ! $REPLY =~ ^[Nn]$ ]]
    then
      cp /usr/local/share/tpf/org.rncbc.QjackCtl.plist $qjconffile
      echo "Done."
    else
      echo "Skipping..."
    fi
  else
    cp /usr/local/share/tpf/org.rncbc.QjackCtl.plist $qjconffile
    echo "Done."
  fi
else
  echo "Skipping..."
fi

# Install pd configuration
read -p "Write pd configuration file? Y/n " -r
if [[ ! $REPLY =~ ^[Nn]$ ]]
then
  pdconffile=~/Library/Preferences/org.puredata.pd.plist
  if [ -f $pdconffile ]
  then
    read -p "Overwrite existing pd configuration file? Y/n " -r
    if [[ ! $REPLY =~ ^[Nn]$ ]]
    then
      cp /usr/local/share/tpf/org.puredata.pd.plist $pdconffile
      echo "Done."
    else
      echo "Skipping..."
    fi
  else
    cp /usr/local/share/tpf/org.puredata.pd.plist $pdconffile
    echo "Done."
  fi
else
  echo "Skipping..."
fi