mirror of
https://github.com/stevejenkins/pihole-cloudsync.git
synced 2024-08-30 18:22:11 +00:00
Added git status test
This commit is contained in:
parent
c253588f8f
commit
9e7810607e
@ -46,18 +46,40 @@ do
|
|||||||
if [ -n "${CHANGED}" ]; then
|
if [ -n "${CHANGED}" ]; then
|
||||||
echo 'changed';
|
echo 'changed';
|
||||||
else
|
else
|
||||||
echo 'not changed';
|
echo 'Remote repo matches local Pi-hole lists. No further action required.';
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Pull / Download
|
# Pull / Download
|
||||||
elif [ "$arg" == "--pull" ] || [ "$arg" == "--download" ] || [ "$arg" == "-d" ]
|
elif [ "$arg" == "--pull" ] || [ "$arg" == "--download" ] || [ "$arg" == "-d" ]
|
||||||
then
|
then
|
||||||
echo "Pull (Download) argument detected."
|
echo "Pull (Download) argument detected."
|
||||||
|
cd $personal_git_dir || exit
|
||||||
|
CHANGED=$(git --work-tree=$personal_git_dir status --porcelain)
|
||||||
|
if [ -n "${CHANGED}" ]; then
|
||||||
|
echo 'changed';
|
||||||
|
else
|
||||||
|
echo 'Local Pi-hole lists match remote repo. No further action required.';
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Help
|
# Help
|
||||||
elif [ "$arg" == "--help" ] || [ "$arg" == "-h" ]
|
elif [ "$arg" == "--help" ] || [ "$arg" == "-h" ]
|
||||||
then
|
then
|
||||||
echo "Help argument detected."
|
cat << EOF
|
||||||
|
Usage: pihole-cloudsync <option>
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--push, --upload, -u Push (upload) your Pi-hole lists to GitHub
|
||||||
|
--pull, --download, -d Pull (download) your lists from GitHub
|
||||||
|
--help, -h Show this help dialog
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
'pihole --push' to push/upload your lists to GitHub
|
||||||
|
'pihole --pull' to pull/download your lists from GitHub
|
||||||
|
|
||||||
|
Project Home: https://github.com/stevejenkins/pihole-cloudsync
|
||||||
|
EOF
|
||||||
|
|
||||||
# Invalid commang line argument was passed
|
# Invalid commang line argument was passed
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user