If statement problems
This commit is contained in:
parent
4ae67d4b11
commit
df0b656f94
16
run.sh
16
run.sh
@ -4,15 +4,15 @@ version_file=/etc/lixonet/version
|
|||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
current_version=`cat $version_file || echo 0`
|
current_version=`cat $version_file || echo 0` &&
|
||||||
git fetch
|
git fetch &&
|
||||||
latest_commit=`git log "--format=%G? %H" | grep ^G | head -n 1 | cut -d' ' -f2`
|
latest_commit=`git log "--format=%G? %H" | grep ^G | head -n 1 | cut -d' ' -f2` &&
|
||||||
git checkout $latest_commit
|
git checkout $latest_commit &&
|
||||||
checkout_version=`cat version`
|
checkout_version=`cat version` &&
|
||||||
if [ "$checkout_version" -gt "$current_version" ]; then
|
if [ "$checkout_version" -gt "$current_version" ]; then
|
||||||
echo "Updating to version $checkout_version..."
|
echo "Updating to version $checkout_version..." &&
|
||||||
chmod +x build.sh && ./build.sh
|
chmod +x build.sh && ./build.sh &&
|
||||||
echo "Updated to version $checkout_version."
|
echo "Updated to version $checkout_version." &&
|
||||||
echo $checkout_version > $version_file
|
echo $checkout_version > $version_file
|
||||||
fi
|
fi
|
||||||
} || {
|
} || {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user