ihsec icon indicating copy to clipboard operation
ihsec copied to clipboard

Not work in mac

Open peng051410 opened this issue 7 years ago • 10 comments

I got you config to my mac! when i run ihsec set conifgname i found the config folder link in .emacs.d/, the result bellow: image How can i fix it ?

peng051410 avatar Feb 06 '18 00:02 peng051410

I found i need to remove .emacs.d folder! it works! but some command not friendly for mac, can you make it better?

peng051410 avatar Feb 06 '18 00:02 peng051410

You'd need to specify what you mean by making it better. I do not use macOS nor do I have access to any devices that use it, so unless you tell me exactly what the issue is I might not be able to help.

daedreth avatar Feb 06 '18 00:02 daedreth

https://github.com/daedreth/ihsec/blob/a7d454a1b1e4f222aa2e80c665e5174c167323e2/Makefile#L10 install -D option not in mac: image

peng051410 avatar Feb 06 '18 02:02 peng051410

if you do echo $OSTYPE in your terminal, what does it show? Also, what version of macOS are you on?

daedreth avatar Feb 06 '18 11:02 daedreth

echo $OSTYPE show me darwin17.0. mac os version 10.13.3 (17D47)!

peng051410 avatar Feb 06 '18 12:02 peng051410

pushed a fix, see if it works

daedreth avatar Feb 06 '18 12:02 daedreth

Hi

Thanks very much for making this public — it's a great solution to a big irritation!

FWIW, the fix was still failing to work on my Macs (both on High Sierra) — the problem seems to be the the $OSTYPE variable is stripped down to STYPE for some reason, so the actual line reads

if [[ "STYPE" == "darwin"* ]] etc

when it is run and it doesn't pick up it's on a Mac. No idea why...

The fix was simple for me (as I don't need it on Linux) — just delete everything apart from the mac relevant branch of the if statement, leaving just

cp ihsec.sh /usr/local/bin/ihsec; chmod 755 /usr/local/bin/ihsec

Everything then works as planned. (I've mentioned it here in case it helps debugging (it's a problem with the if statement, not the cp statement) and in case any other Mac user is reading this.)

Many thanks again for making it public — really appreciate it!

brookter avatar Apr 15 '18 17:04 brookter

I'll leave it open for people to see, great job figuring it out!

daedreth avatar Apr 15 '18 17:04 daedreth

Thanks Dawid!

On 15 Apr 2018, at 18:57, Dawid Eckert [email protected] wrote:

I'll leave it open for people to see, great job figuring it out!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/daedreth/ihsec/issues/5#issuecomment-381425150, or mute the thread https://github.com/notifications/unsubscribe-auth/ACxw7FsIWRHLpaJ1r3TRY7ZbWjJJgzL_ks5to4ntgaJpZM4R6Tal.

brookter avatar Apr 15 '18 17:04 brookter

The 1st problem I found with the 'if' statement is that the regex symbol $ is not escaped properly, thus giving us the output @brookter provides.

It seems there is another issue that I'm still researching on Linux. I don't think that the makefile is being interpreted by bash correctly (or when it is, it spits out the entire statement as if I appended echo before the statement). I will record anything else I find in issue #7 .

IVXCVI avatar May 23 '18 08:05 IVXCVI