aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/pdns-gui/0010-replace-bash-with-sh.patch
blob: e684009bffab95bfb5360efb41269ffd90f373d9 (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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
--- ./batch/install.sh.orig
+++ ./batch/install.sh
@@ -1,10 +1,11 @@
-#!/bin/bash
+#!/bin/sh
 
-abspath=$(cd ${0%/*} && pwd -P) 
+abspath=${0%/*}
+php=$(which php)
 
-if [[ `which php` == "" ]]; then
+if [ -z "$php" ]; then
   echo "Error: can't locate PHP CLI interpreter"
   exit 1
 fi
 
-php -q $abspath/install.php
+$php -q $abspath/install.php
--- ./batch/install.php.orig
+++ ./batch/install.php
@@ -110,7 +110,7 @@
 echo "\n\nAnd make sure 'mod_rewrite' is enabled.\n\n";
 /**
  * Interactively prompts for input without echoing to the terminal.
- * Requires a bash shell or Windows and won't work with
+ * Requires a sh shell or Windows and won't work with
  * safe_mode settings (Uses `shell_exec`)
  */
 function prompt_silent($prompt = "Enter Password:") {
@@ -125,12 +125,12 @@
     unlink($vbscript);
     return $password;
   } else {
-    $command = "/usr/bin/env bash -c 'echo OK'";
+    $command = "/usr/bin/env sh -c 'echo OK'";
     if (rtrim(shell_exec($command)) !== 'OK') {
-      trigger_error("Can't invoke bash");
+      trigger_error("Can't invoke sh");
       return;
     }
-    $command = "/usr/bin/env bash -c 'read -s -p \""
+    $command = "/usr/bin/env sh -c 'read -s -p \""
       . addslashes($prompt)
       . "\" mypassword && echo \$mypassword'";
     $password = rtrim(shell_exec($command));
--- ./batch/upgrade.sh.orig
+++ ./batch/upgrade.sh
@@ -1,10 +1,11 @@
-#!/bin/bash
+#!/bin/sh
 
-abspath=$(cd ${0%/*} && pwd -P) 
+abspath=${0%/*}
+php=$(which php)
 
-if [[ `which php` == "" ]]; then
+if [ -z "$php" ]; then
   echo "Error: can't locate PHP CLI interpreter"
   exit 1
 fi
 
-php -q $abspath/upgrade.php
+$php -q $abspath/upgrade.php
--- ./batch/dev/refresh.sh.orig
+++ ./batch/dev/refresh.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 echo ""
 echo ""
@@ -15,8 +15,7 @@
 echo -n "  Do you want to continue [no]: "
 read confirm
 
-if [[ "$confirm" != "YES" ]]
-then
+if [ "$confirm" != "YES" ]; then
   exit 0
 fi