Skip to content

Commit 6c84f00

Browse files
author
Flavius12
committed
Create phartools.sh
1 parent 66ece81 commit 6c84f00

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

phartools.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
if type php >/dev/null 2>&1; then #Check if PHP is installed
3+
php phartools.php $@
4+
else
5+
while true; do
6+
read -p "PHP is not installed! Do you want to install it now? (y,n)" yn
7+
case $yn in
8+
[Yy]* ) sudo apt-get install php5-cli; sudo sed -i.bak 's/^;phar.readonly/phar.readonly/' /etc/php5/cli/php.ini; sudo sed -i.bak 's/phar.readonly = On/phar.readonly = 0/' /etc/php5/cli/php.ini; exit;; #based on default php.ini config (by default ;phar.readonly = 0 or phar.readonly = On)
9+
[Nn]* ) echo "PHP installation cancelled"; exit;;
10+
* ) echo "Please enter a correct answer";;
11+
esac
12+
done
13+
fi

0 commit comments

Comments
 (0)