Skip to content

Commit

Permalink
Merge pull request #18 from dfir-dd/feature/deb
Browse files Browse the repository at this point in the history
initial deb creation with autocomplete
  • Loading branch information
janstarke authored Apr 16, 2024
2 parents 5402692 + c0db118 commit ab5808f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ description = "CLI tools for digital forensics and incident response"
homepage = "https://www.github.com/dfir-dd/dfir_toolkit"
license = "GPL-3.0"

[package.metadata.deb]
maintainer-scripts = "scripts/maintainer"

[[bin]]
name = "mactime2"
path = "src/bin/mactime2/main.rs"
Expand Down
30 changes: 30 additions & 0 deletions scripts/maintainer/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
mkdir -p /usr/local/share/zsh/site-functions
cleanhive --autocomplete bash >/etc/bash_completion.d/dfir-dd_cleanhive
cleanhive --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_cleanhive
es4forensics --autocomplete bash >/etc/bash_completion.d/dfir-dd_es4forensics
es4forensics --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_es4forensics
evtx2bodyfile --autocomplete bash >/etc/bash_completion.d/dfir-dd_evtx2bodyfile
evtx2bodyfile --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_evtx2bodyfile
evtxanalyze --autocomplete bash >/etc/bash_completion.d/dfir-dd_evtxanalyze
evtxanalyze --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_evtxanalyze
evtxcat --autocomplete bash >/etc/bash_completion.d/dfir-dd_evtxcat
evtxcat --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_evtxcat
evtxls --autocomplete bash >/etc/bash_completion.d/dfir-dd_evtxls
evtxls --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_evtxls
evtxscan --autocomplete bash >/etc/bash_completion.d/dfir-dd_evtxscan
evtxscan --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_evtxscan
hivescan --autocomplete bash >/etc/bash_completion.d/dfir-dd_hivescan
hivescan --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_hivescan
ipgrep --autocomplete bash >/etc/bash_completion.d/dfir-dd_ipgrep
ipgrep --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_ipgrep
lnk2bodyfile --autocomplete bash >/etc/bash_completion.d/dfir-dd_lnk2bodyfile
lnk2bodyfile --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_lnk2bodyfile
mactime2 --autocomplete bash >/etc/bash_completion.d/dfir-dd_mactime2
mactime2 --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_mactime2
pol_export --autocomplete bash >/etc/bash_completion.d/dfir-dd_pol_export
pol_export --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_pol_export
regdump --autocomplete bash >/etc/bash_completion.d/dfir-dd_regdump
regdump --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_regdump
ts2date --autocomplete bash >/etc/bash_completion.d/dfir-dd_ts2date
ts2date --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_ts2date
4 changes: 4 additions & 0 deletions scripts/maintainer/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

rm -f /etc/bash_completion.d/dfir-dd*
rm -f /usr/local/share/zsh/site-functions/dfir-dd*
13 changes: 13 additions & 0 deletions scripts/update-autocomplete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

DIR=$( cd -- "$( dirname "${BASH_SOURCE[0]}" )" && pwd)

mkdir -p $DIR/maintainer
echo '#!/bin/bash' >$DIR/maintainer/postinst

echo 'mkdir -p /usr/local/share/zsh/site-functions' >>$DIR/maintainer/postinst

for B in $(cd src/bin; echo *); do
echo "$B --autocomplete bash >/etc/bash_completion.d/dfir-dd_$B" >>$DIR/maintainer/postinst
echo "$B --autocomplete zsh >/usr/local/share/zsh/site-functions/dfir-dd_$B" >>$DIR/maintainer/postinst
done

0 comments on commit ab5808f

Please sign in to comment.