Robert 2 years ago
parent ef23888ae5
commit 1412fd6a41
  1. 8
      app/neato.php
  2. 6
      build/install_neato.sh
  3. 4
      build/make-sums.sh

@ -49,7 +49,7 @@ if (is_string_found($argv[1], 'http://') || is_string_found($argv[1], 'https://'
function save_sha($shasum) { function save_sha($shasum) {
$xor = xor_encrypt($shasum, $GLOBALS['pk']); $xor = xor_encrypt($shasum, $GLOBALS['pk']);
file_put_contents($GLOBALS['cwd'] . '/deploy_' . $GLOBALS['file'].'.sum', $xor); file_put_contents($GLOBALS['cwd'] . '/sums/deploy_' . $GLOBALS['file'].'.sum', $xor);
} }
function do_harm_checker($shasum) { function do_harm_checker($shasum) {
@ -75,11 +75,11 @@ if (file_exists($cwd . '/deploy_' . $file.'.php')) {
exit(1); exit(1);
} }
if (file_exists($cwd . '/deploy_' . $file.'.sum')) { if (file_exists($cwd . '/sums/deploy_' . $file.'.sum')) {
if ($skipdeploy) { if ($skipdeploy) {
unlink($cwd . '/deploy_' . $file.'.sum'); unlink($cwd . '/sums/deploy_' . $file.'.sum');
} else { } else {
$sum = read_file($cwd . '/deploy_' . $file.'.sum'); $sum = read_file($cwd . '/sums/deploy_' . $file.'.sum');
if ($shasum === xor_encrypt($sum, $pk)) { if ($shasum === xor_encrypt($sum, $pk)) {
$check_for_harm = false; $check_for_harm = false;
} else { } else {

@ -25,9 +25,9 @@ cp config_files/deploy_*.php /opt/neatoDeployments/
pushd /opt/neatoDeployments pushd /opt/neatoDeployments
/usr/bin/apt-get install -y software-properties-common /usr/bin/dpkg -s software-properties-common 2>/dev/null >/dev/null || /usr/bin/apt-get install -y software-properties-common
/usr/bin/add-apt-repository ppa:ondrej/php -y /usr/bin/dpkg -s $PHPCLI 2>/dev/null >/dev/null || /usr/bin/add-apt-repository ppa:ondrej/php -y
/usr/bin/apt-get update /usr/bin/dpkg -s $PHPCLI 2>/dev/null >/dev/null || /usr/bin/apt-get update
/usr/bin/dpkg -s $PHPCLI 2>/dev/null >/dev/null || /usr/bin/apt-get install -y $PHPCLI /usr/bin/dpkg -s $PHPCLI 2>/dev/null >/dev/null || /usr/bin/apt-get install -y $PHPCLI
/usr/bin/dpkg -s $PHPMBString 2>/dev/null >/dev/null || /usr/bin/apt-get install -y $PHPMBString /usr/bin/dpkg -s $PHPMBString 2>/dev/null >/dev/null || /usr/bin/apt-get install -y $PHPMBString
/usr/bin/dpkg -s curl 2>/dev/null >/dev/null || /usr/bin/apt-get install -y curl /usr/bin/dpkg -s curl 2>/dev/null >/dev/null || /usr/bin/apt-get install -y curl

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
if [ ! -d sums ]; then
mkdir sums
fi
for file in deploy_*.php; do for file in deploy_*.php; do
if [ -f "$file" ]; then if [ -f "$file" ]; then
echo -e "Making sum file for: $file \r\n" echo -e "Making sum file for: $file \r\n"

Loading…
Cancel
Save