Skip to content

Commit

Permalink
Merge pull request #2561 from RestyaPlatform/issue/2555
Browse files Browse the repository at this point in the history
Changes #2555: install and uninstall shell script restyaboard are added
  • Loading branch information
S. Sivachidambaram authored Apr 24, 2019
2 parents 2550f47 + bea5ea0 commit 7a23054
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 36 deletions.
2 changes: 1 addition & 1 deletion client/js/templates/about_us.jst.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="about-block col-xs-pull-0 col-xs-push-0">
<h1><a title="<%- SITE_NAME %>" href="javascript:void(0);"><img src="img/logo.png" alt="[Image: <%- SITE_NAME %> ]" title="<%- SITE_NAME %>" class="img-responsive center-block"/></a> </h1>
<small class="show text-center">v 0.6.7 (2019-04-22)</small>
<small class="show text-center">v 0.6.7 (2019-04-24)</small>
<h3><%- i18next.t("Technologies and Components") %></h3>
<ul class="list-unstyled">
<li>Restya platform <a class="text-primary" target="_blank" title="http://restya.com/?utm_source=Restyaboard - <%- SITE_NAME %>&utm_medium=web&utm_campaign=about_us" href="http://restya.com/">http://restya.com/ </a></li>
Expand Down
43 changes: 13 additions & 30 deletions restyaboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,15 @@
find "$dir/client/apps" -type d -exec chmod 755 {} \;
find "$dir/client/apps" -type f -exec chmod 644 {} \;
chmod 0777 $dir/client/apps/**/*.json
: > /var/spool/cron/crontabs/root
sed -i "s/*\/5 * * * * $dir\/server\/php\/shell\/main.sh//" /var/spool/cron/crontabs/root

if ([ "$OS_REQUIREMENT" = "Ubuntu" ] || [ "$OS_REQUIREMENT" = "Debian" ] || [ "$OS_REQUIREMENT" = "Raspbian" ])
then
: > /var/spool/cron/crontabs/root
echo "*/5 * * * * $dir/server/php/shell/main.sh > /dev/null 2> /dev/null" >> /var/spool/cron/crontabs/root
else
: > /var/spool/cron/root
echo "*/5 * * * * $dir/server/php/shell/main.sh > /dev/null 2> /dev/null" >> /var/spool/cron/root
fi
}

update_version()
Expand Down Expand Up @@ -742,20 +749,8 @@
sed -i "s/^.*'R_DB_HOST'.*$/define('R_DB_HOST', '${POSTGRES_DBHOST}');/g" "$dir/server/php/config.inc.php"
sed -i "s/^.*'R_DB_PORT'.*$/define('R_DB_PORT', '${POSTGRES_DBPORT}');/g" "$dir/server/php/config.inc.php"

echo "Setting up cron for every 5 minutes to send email notification to user, if the user chosen notification type as instant..."
echo "*/5 * * * * $dir/server/php/shell/instant_email_notification.sh > /dev/null 2> /dev/null" >> /var/spool/cron/crontabs/root

echo "Setting up cron for every 1 hour to send email notification to user, if the user chosen notification type as periodic..."
echo "0 * * * * $dir/server/php/shell/periodic_email_notification.sh > /dev/null 2> /dev/null" >> /var/spool/cron/crontabs/root

echo "Setting up cron for every 30 minutes to fetch IMAP email..."
echo "*/30 * * * * $dir/server/php/shell/imap.sh > /dev/null 2> /dev/null" >> /var/spool/cron/crontabs/root

echo "Setting up cron for every 5 minutes to send activities to webhook..."
echo "*/5 * * * * $dir/server/php/shell/webhook.sh > /dev/null 2> /dev/null" >> /var/spool/cron/crontabs/root

echo "Setting up cron for every 5 minutes to send email notification to past due..."
echo "*/5 * * * * $dir/server/php/shell/card_due_notification.sh > /dev/null 2> /dev/null" >> /var/spool/cron/crontabs/root
echo "Setting up cron for every 5 minutes.."
echo "*/5 * * * * $dir/server/php/shell/main.sh > /dev/null 2> /dev/null" >> /var/spool/cron/crontabs/root

set +x
echo "Do you want to install Restyaboard apps (y/n)?"
Expand Down Expand Up @@ -1192,20 +1187,8 @@
sed -i "s/^.*'R_DB_HOST'.*$/define('R_DB_HOST', '${POSTGRES_DBHOST}');/g" "$dir/server/php/config.inc.php"
sed -i "s/^.*'R_DB_PORT'.*$/define('R_DB_PORT', '${POSTGRES_DBPORT}');/g" "$dir/server/php/config.inc.php"

echo "Setting up cron for every 5 minutes to send email notification to user, if the user chosen notification type as instant..."
echo "*/5 * * * * $dir/server/php/shell/instant_email_notification.sh > /dev/null 2> /dev/null" >> /var/spool/cron/root

echo "Setting up cron for every 1 hour to send email notification to user, if the user chosen notification type as periodic..."
echo "0 * * * * $dir/server/php/shell/periodic_email_notification.sh > /dev/null 2> /dev/null" >> /var/spool/cron/root

echo "Setting up cron for every 30 minutes to fetch IMAP email..."
echo "*/30 * * * * $dir/server/php/shell/imap.sh > /dev/null 2> /dev/null" >> /var/spool/cron/root

echo "Setting up cron for every 5 minutes to send activities to webhook..."
echo "*/5 * * * * $dir/server/php/shell/webhook.sh > /dev/null 2> /dev/null" >> /var/spool/cron/root

echo "Setting up cron for every 5 minutes to send email notification to past due..."
echo "*/5 * * * * $dir/server/php/shell/card_due_notification.sh > /dev/null 2> /dev/null" >> /var/spool/cron/root
echo "Setting up cron for every 5 minutes..."
echo "*/5 * * * * $dir/server/php/shell/main.sh > /dev/null 2> /dev/null" >> /var/spool/cron/root

echo "Reset php-fpm (use unix socket mode)..."
if [ -f "/run/php/php7.2-fpm.sock" ]; then
Expand Down
11 changes: 6 additions & 5 deletions restyaboard_uninstall.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
fi

POSTGRES_DBHOST=localhost
POSTGRES_DBNAME=restyaboardtest
POSTGRES_DBUSER=restyat
POSTGRES_DBPASS=hjVl2!rGdt
POSTGRES_DBNAME=restyaboard
POSTGRES_DBUSER=restya
POSTGRES_DBPASS=hjVl2!rGd
POSTGRES_DBPORT=5432
DOWNLOAD_DIR=/opt/restyaboard
version=$(cat ${DOWNLOAD_DIR}/release)
Expand Down Expand Up @@ -68,8 +68,8 @@
rm -rf /etc/nginx/conf.d/restyaboard.conf

echo "Removing Restyaboard temporary files..."
rm /tmp/restya_site_url_for_shell.php
rm /tmp/restya_client_information.php
rm -rf "$dir/tmp/cache/restya_site_url_for_shell.php"
rm -rf "$dir/tmp/cache/restya_client_information.php"

echo "Clearing the Restyaboard crons"
sed -i '/\*\/5 \* \* \* \* $dir\/server\/php\/shell\/instant_email_notification.sh > \/dev\/null 2> \/dev\/null/d' /var/spool/cron/crontabs/root
Expand Down Expand Up @@ -135,5 +135,6 @@
yum remove nginx
esac
fi
rm -rf ${DOWNLOAD_DIR}/release
esac
} 2>&1 | tee -a restyaboard_uninstall.log

0 comments on commit 7a23054

Please sign in to comment.