Execute command after dpkg installation?
up vote
0
down vote
favorite
I just got inspired of this project:
http://www.opendesktop.org/content/show.php?content=145633
Well , i wanted to do a similar thing , after dpkg places something new in /usr/share/applications directory , but where should my script point to , and the parameter to pass in ?
installation dpkg
add a comment |
up vote
0
down vote
favorite
I just got inspired of this project:
http://www.opendesktop.org/content/show.php?content=145633
Well , i wanted to do a similar thing , after dpkg places something new in /usr/share/applications directory , but where should my script point to , and the parameter to pass in ?
installation dpkg
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I just got inspired of this project:
http://www.opendesktop.org/content/show.php?content=145633
Well , i wanted to do a similar thing , after dpkg places something new in /usr/share/applications directory , but where should my script point to , and the parameter to pass in ?
installation dpkg
I just got inspired of this project:
http://www.opendesktop.org/content/show.php?content=145633
Well , i wanted to do a similar thing , after dpkg places something new in /usr/share/applications directory , but where should my script point to , and the parameter to pass in ?
installation dpkg
installation dpkg
edited Jun 18 '12 at 17:48
Bruno Pereira
58.9k26177203
58.9k26177203
asked Sep 30 '11 at 12:09
daisy
2,796124171
2,796124171
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
If the script do not takes parameters, add a file in /etc/apt/apt.conf.d/, for example 92local (numbers are used to force execution order of scripts in that directory), with the following content:
DPkg::Post-Invoke { "/path-to/my-script"; };
and remember to make it executable.
Cannot find right now information on how to pass parameter or input to the script.
If can be of help, when running apt on command line, you should find the command line in the environment variable SUDO_COMMAND.
i modified that script to find all the .desktop files automatically , so far my problem is resolved , thanks !
– daisy
Sep 30 '11 at 23:44
add a comment |
up vote
0
down vote
I have found a way to get the commandline of the APT command executed:
Create a file /etc/apt/apt.conf.d/90my_dpkg_post_invoke with content
DPkg::Post-Invoke { "/usr/local/lib/my_dpkg_post_invoke.sh"; }
Create an executable file /usr/local/lib/my_dpkg_post_invoke.sh with content
#!/bin/bash
APTPID=$( ps -ho ppid "${PPID}" )
APTPID="${APTPID## }" # trim leading spaces
APTCMD=$( ps -ho args "${APTPID}" )
APTCMD="${APTCMD## }" # trim leading spaces
echo "#### APT Command: ${APTCMD}"
Now you can extend the executable file with a test if the ${APTCMD} contains a string you want to trigger an action for.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
If the script do not takes parameters, add a file in /etc/apt/apt.conf.d/, for example 92local (numbers are used to force execution order of scripts in that directory), with the following content:
DPkg::Post-Invoke { "/path-to/my-script"; };
and remember to make it executable.
Cannot find right now information on how to pass parameter or input to the script.
If can be of help, when running apt on command line, you should find the command line in the environment variable SUDO_COMMAND.
i modified that script to find all the .desktop files automatically , so far my problem is resolved , thanks !
– daisy
Sep 30 '11 at 23:44
add a comment |
up vote
5
down vote
accepted
If the script do not takes parameters, add a file in /etc/apt/apt.conf.d/, for example 92local (numbers are used to force execution order of scripts in that directory), with the following content:
DPkg::Post-Invoke { "/path-to/my-script"; };
and remember to make it executable.
Cannot find right now information on how to pass parameter or input to the script.
If can be of help, when running apt on command line, you should find the command line in the environment variable SUDO_COMMAND.
i modified that script to find all the .desktop files automatically , so far my problem is resolved , thanks !
– daisy
Sep 30 '11 at 23:44
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
If the script do not takes parameters, add a file in /etc/apt/apt.conf.d/, for example 92local (numbers are used to force execution order of scripts in that directory), with the following content:
DPkg::Post-Invoke { "/path-to/my-script"; };
and remember to make it executable.
Cannot find right now information on how to pass parameter or input to the script.
If can be of help, when running apt on command line, you should find the command line in the environment variable SUDO_COMMAND.
If the script do not takes parameters, add a file in /etc/apt/apt.conf.d/, for example 92local (numbers are used to force execution order of scripts in that directory), with the following content:
DPkg::Post-Invoke { "/path-to/my-script"; };
and remember to make it executable.
Cannot find right now information on how to pass parameter or input to the script.
If can be of help, when running apt on command line, you should find the command line in the environment variable SUDO_COMMAND.
answered Sep 30 '11 at 14:01
enzotib
61.6k5128152
61.6k5128152
i modified that script to find all the .desktop files automatically , so far my problem is resolved , thanks !
– daisy
Sep 30 '11 at 23:44
add a comment |
i modified that script to find all the .desktop files automatically , so far my problem is resolved , thanks !
– daisy
Sep 30 '11 at 23:44
i modified that script to find all the .desktop files automatically , so far my problem is resolved , thanks !
– daisy
Sep 30 '11 at 23:44
i modified that script to find all the .desktop files automatically , so far my problem is resolved , thanks !
– daisy
Sep 30 '11 at 23:44
add a comment |
up vote
0
down vote
I have found a way to get the commandline of the APT command executed:
Create a file /etc/apt/apt.conf.d/90my_dpkg_post_invoke with content
DPkg::Post-Invoke { "/usr/local/lib/my_dpkg_post_invoke.sh"; }
Create an executable file /usr/local/lib/my_dpkg_post_invoke.sh with content
#!/bin/bash
APTPID=$( ps -ho ppid "${PPID}" )
APTPID="${APTPID## }" # trim leading spaces
APTCMD=$( ps -ho args "${APTPID}" )
APTCMD="${APTCMD## }" # trim leading spaces
echo "#### APT Command: ${APTCMD}"
Now you can extend the executable file with a test if the ${APTCMD} contains a string you want to trigger an action for.
add a comment |
up vote
0
down vote
I have found a way to get the commandline of the APT command executed:
Create a file /etc/apt/apt.conf.d/90my_dpkg_post_invoke with content
DPkg::Post-Invoke { "/usr/local/lib/my_dpkg_post_invoke.sh"; }
Create an executable file /usr/local/lib/my_dpkg_post_invoke.sh with content
#!/bin/bash
APTPID=$( ps -ho ppid "${PPID}" )
APTPID="${APTPID## }" # trim leading spaces
APTCMD=$( ps -ho args "${APTPID}" )
APTCMD="${APTCMD## }" # trim leading spaces
echo "#### APT Command: ${APTCMD}"
Now you can extend the executable file with a test if the ${APTCMD} contains a string you want to trigger an action for.
add a comment |
up vote
0
down vote
up vote
0
down vote
I have found a way to get the commandline of the APT command executed:
Create a file /etc/apt/apt.conf.d/90my_dpkg_post_invoke with content
DPkg::Post-Invoke { "/usr/local/lib/my_dpkg_post_invoke.sh"; }
Create an executable file /usr/local/lib/my_dpkg_post_invoke.sh with content
#!/bin/bash
APTPID=$( ps -ho ppid "${PPID}" )
APTPID="${APTPID## }" # trim leading spaces
APTCMD=$( ps -ho args "${APTPID}" )
APTCMD="${APTCMD## }" # trim leading spaces
echo "#### APT Command: ${APTCMD}"
Now you can extend the executable file with a test if the ${APTCMD} contains a string you want to trigger an action for.
I have found a way to get the commandline of the APT command executed:
Create a file /etc/apt/apt.conf.d/90my_dpkg_post_invoke with content
DPkg::Post-Invoke { "/usr/local/lib/my_dpkg_post_invoke.sh"; }
Create an executable file /usr/local/lib/my_dpkg_post_invoke.sh with content
#!/bin/bash
APTPID=$( ps -ho ppid "${PPID}" )
APTPID="${APTPID## }" # trim leading spaces
APTCMD=$( ps -ho args "${APTPID}" )
APTCMD="${APTCMD## }" # trim leading spaces
echo "#### APT Command: ${APTCMD}"
Now you can extend the executable file with a test if the ${APTCMD} contains a string you want to trigger an action for.
answered 4 hours ago
Jeroen Vermeulen - MageHost
22026
22026
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f63717%2fexecute-command-after-dpkg-installation%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password