I need a little bit of help regards a simple init.d script that is running on a raspberry pi. The Script is starting an application but I need to secure it because i don't want that the system is working on a clone (with dd) so easily.
When I'm using the code right now, it works when the output is the same, but it also works when it contains different values. So the init.d script is starting in both cases.
#!/bin/sh
### BEGIN INIT INFO
....
### END INIT INFO
start() {
licensecheck=`/usr/share/License/CheckLicense.sh`
license=`cat /home/pi/license.txt`
if [ $licensecheck != $license ]
then
exit
fi
sleep 5
mount ...
}
case "$1" in
start)
start
;;
stop)
stop
;;
retart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|uninstall}"
esac
These are the 2 sources, that i want to compare:
root@raspberrypi:/home/pi# cat /home/pi/license.txt fc3731c489b70c118386cd7fa7b29624b8:27:eb:15:79:a2
root@raspberrypi:/home/pi# /usr/share/License/CheckLicense.sh fc3731c489b70c118386cd7fa7b29624b8:27:eb:15:79:a2
Aucun commentaire:
Enregistrer un commentaire