Version: 0.1.00.2.00.2.10.3.00.3.10.4.00.4.10.4.20.4.30.5.00.5.10.5.20.5.30.5.40.5.50.6.00.6.10.7.00.8.00.8.10.8.20.8.30.8.40.8.50.8.60.8.70.8.80.8.90.8.100.8.110.8.120.8.130.8.140.8.150.8.160.9.00.9.10.9.20.9.30.9.40.9.50.9.60.9.70.9.100.9.110.9.120.9.130.9.140.9.150.9.160.9.170.9.200.9.210.9.220.9.230.9.250.9.260.9.270.9.280.9.290.9.300.9.310.9.340.9.350.9.360.9.370.9.380.9.390.9.400.9.410.9.420.9.430.9.440.9.450.9.460.9.470.9.480.9.490.9.500.9.510.9.520.9.530.9.540.9.550.9.560.9.570.9.580.9.590.9.600.9.610.9.620.9.630.9.640.9.650.9.660.9.670.9.690.9.700.9.710.9.720.9.730.9.740.9.750.9.760.9.770.9.780.9.790.9.800.9.810.9.820.9.830.9.840.9.850.9.880.9.890.9.900.9.920.9.930.9.940.9.1020.10.00.10.10.10.20.10.31.0.11.0.21.0.31.0.41.0.51.0.61.0.71.0.81.0.91.0.101.0.111.0.121.0.131.0.141.0.151.0.161.0.171.0.181.0.191.0.20
#!/bin/bash
reason=$1
target=$2
[ -z "$target" ] && target="src"
[ -z "$reason" ] && reason="any"
hash=`find "$target" -type f -print0 | sort -z | xargs -0 md5sum | md5sum | cut -d " " -f 1`
mkdir -p temp
[ -f "temp/_last_hash.$reason" ] && [ "`cat temp/_last_hash.$reason`" = "$hash" ] && exit 0
echo $hash > temp/_last_hash.$reason
exit 1