#!/bin/bash WEB_PATH='/home/www/project' WEB_USER='www' WEB_USERGROUP='www' echo "Start ..." cd $WEB_PATH echo "pulling source code..." sudo git fetch --all sudo git reset --hard origin/master sudo git clean -f sudo git pull echo "changing permissions..." sudo chown -R $WEB_USER:$WEB_USERGROUP $WEB_PATH sudo chmod -R 0755 $WEB_PATH echo "Finished."