Browse Source

Specify node package to install within template

Bob Mottram 7 years ago
parent
commit
1be51d8c3c
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      src/freedombone-template

+ 13
- 0
src/freedombone-template View File

36
 app_repo_commit='TODO'
36
 app_repo_commit='TODO'
37
 app_php=
37
 app_php=
38
 app_node=
38
 app_node=
39
+app_nodeapp=
39
 app_onion_only=
40
 app_onion_only=
40
 app_port=
41
 app_port=
41
 app_port_internal=
42
 app_port_internal=
63
     echo $'     --port [number]                   Port number for the app'
64
     echo $'     --port [number]                   Port number for the app'
64
     echo $'     --portinternal [number]           Internal port between a daemon and the web server'
65
     echo $'     --portinternal [number]           Internal port between a daemon and the web server'
65
     echo $'     --node [yes|no]                   Is this a nodejs app?'
66
     echo $'     --node [yes|no]                   Is this a nodejs app?'
67
+    echo $'     --nodeapp [package]               Specify a nodejs package to install'
66
     echo $'  -o --onion [yes|no]                  Is this app only available on an onion address?'
68
     echo $'  -o --onion [yes|no]                  Is this app only available on an onion address?'
67
     echo $'  -p --php [yes|no]                    Is this a PHP app?'
69
     echo $'  -p --php [yes|no]                    Is this a PHP app?'
68
     echo $'  -s --daemon [yes|no]                 Add a daemon'
70
     echo $'  -s --daemon [yes|no]                 Add a daemon'
116
             shift
118
             shift
117
             app_node="$1"
119
             app_node="$1"
118
             ;;
120
             ;;
121
+        --nodeapp)
122
+            shift
123
+            app_nodeapp="$1"
124
+            ;;
119
         -s|--daemon|--systemd)
125
         -s|--daemon|--systemd)
120
             shift
126
             shift
121
             if [[ "$1" == 'yes' ]]; then
127
             if [[ "$1" == 'yes' ]]; then
193
     exit 8
199
     exit 8
194
 fi
200
 fi
195
 
201
 
202
+if [ "$app_nodeapp" ]; then
203
+    app_node='yes'
204
+fi
205
+
196
 if [ ! $app_webui ]; then
206
 if [ ! $app_webui ]; then
197
     if [ ! "$app_dir" ]; then
207
     if [ ! "$app_dir" ]; then
198
         app_dir=/etc/${app_name}
208
         app_dir=/etc/${app_name}
600
 if [[ "$app_node" == 'yes' ]]; then
610
 if [[ "$app_node" == 'yes' ]]; then
601
     echo "install_nodejs ${app_name}"
611
     echo "install_nodejs ${app_name}"
602
 fi
612
 fi
613
+if [ "$app_nodeapp" ]; then
614
+    echo "npm install -g ${app_nodeapp}"
615
+fi
603
 if [[ "$app_php" == 'yes' ]]; then
616
 if [[ "$app_php" == 'yes' ]]; then
604
     echo '    apt-get -yq install php-gettext php-curl php-gd php-mysql git curl'
617
     echo '    apt-get -yq install php-gettext php-curl php-gd php-mysql git curl'
605
     echo '    apt-get -yq install memcached php-memcached php-intl exiftool libfcgi0ldbl'
618
     echo '    apt-get -yq install memcached php-memcached php-intl exiftool libfcgi0ldbl'