diff options
author | TF | 2022-01-10 18:24:23 +0100 |
---|---|---|
committer | TF | 2022-01-11 14:20:57 +0100 |
commit | a4ed67787cb156695118dbc5579e5fd66ff52806 (patch) | |
tree | 64c275ecf0c3e3386d8aa1644fccc0ae0a8d6048 /kesl-gui.install | |
parent | 4526fd4053a631f28cb3189187463fd963af8d32 (diff) | |
download | aur-a4ed67787cb156695118dbc5579e5fd66ff52806.tar.gz |
fix: tmp dir removal,admin user on kesl-gui install
Signed-off-by: TF <mail@sedi.one>
Diffstat (limited to 'kesl-gui.install')
-rw-r--r-- | kesl-gui.install | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/kesl-gui.install b/kesl-gui.install index eaa6476d757e..4c87316b9dd5 100644 --- a/kesl-gui.install +++ b/kesl-gui.install @@ -1,11 +1,26 @@ +create_tmp(){ + export TMPDIR=/tmp + # avoid re-creating tmp dir when already exists + [ ! -d "$KTMP" ] && KTMP=$(mktemp -d -t kesl.XXXXX) + echo "$KTMP" +} + +remove_tmp(){ + KTMP="$1" + [ -d "$KTMP" ] && rm -rf "$KTMP" +} post_install(){ - echo $FUNCNAME + #echo $FUNCNAME + KTMP=$(create_tmp) /var/opt/kaspersky/kesl-gui/pkgscripts/postinst configure # execute the kesl installer with preconfigured settings echo -e "\e[32m\e[1m ... starting '/opt/kaspersky/kesl/bin/kesl-setup.pl' now\e[0m\n(no need to execute it again after installation has finished)." - /opt/kaspersky/kesl/bin/kesl-setup.pl --autoinstall=/var/opt/kaspersky/kesl/pkgscripts/kesl.ini + cp /var/opt/kaspersky/kesl/pkgscripts/kesl.ini $KTMP/ + sed -i "s/@YOU@/$SUDO_USER/g" $KTMP/kesl.ini + /opt/kaspersky/kesl/bin/kesl-setup.pl --autoinstall=$KTMP/kesl.ini + remove_tmp "$KTMP" } post_upgrade(){ @@ -16,4 +31,3 @@ pre_remove(){ echo $FUNCNAME /var/opt/kaspersky/kesl-gui/pkgscripts/prerm remove } - |