Stopping unnecessary file writing
This commit is contained in:
parent
f9456be2ec
commit
a6c531e78a
4
Makefile
4
Makefile
@ -13,10 +13,12 @@ install:
|
|||||||
chown root:root /usr/local/sbin/grub2-se-verifyserv
|
chown root:root /usr/local/sbin/grub2-se-verifyserv
|
||||||
chmod 740 /usr/local/sbin/grub2-se-verifyserv
|
chmod 740 /usr/local/sbin/grub2-se-verifyserv
|
||||||
@printf "Done.\n"
|
@printf "Done.\n"
|
||||||
@printf "You may want to enable and start the service: \"systemctl enable grub2-se-verifyserv ; systemctl start grub2-se-verifyserv\"\n" @printf "The file will be called /verified"
|
@printf "You may want to enable and start the service: \"systemctl enable grub2-se-verifyserv ; systemctl start grub2-se-verifyserv\"\n"
|
||||||
|
@printf "The file will be called /verified\n"
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm /usr/sbin/local/grub2-se-verifyserv
|
rm /usr/sbin/local/grub2-se-verifyserv
|
||||||
|
rm /etc/systemd/system/grub2-se-verifyserv.service
|
||||||
@printf "Done.\n"
|
@printf "Done.\n"
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -104,6 +104,7 @@ int main(int argc, char *argv[]){
|
|||||||
|
|
||||||
if(WEXITSTATUS(statval) == STATUS_OK){
|
if(WEXITSTATUS(statval) == STATUS_OK){
|
||||||
// If exit is STATUS_OK, write file with nothing in it
|
// If exit is STATUS_OK, write file with nothing in it
|
||||||
|
if(access(VRFFILE, F_OK) == -1){
|
||||||
FILE *f = fopen(VRFFILE, "w");
|
FILE *f = fopen(VRFFILE, "w");
|
||||||
if(f == NULL){
|
if(f == NULL){
|
||||||
printf("ERROR opening file");
|
printf("ERROR opening file");
|
||||||
@ -111,6 +112,7 @@ int main(int argc, char *argv[]){
|
|||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
// If exit != 0
|
// If exit != 0
|
||||||
if(access(VRFFILE, F_OK) != -1) //File exists?
|
if(access(VRFFILE, F_OK) != -1) //File exists?
|
||||||
|
Loading…
Reference in New Issue
Block a user