Using a bash script, I have a folder that I'd like to remove upon uninstalling a package. That part is simple but what isn't simple is taking into consideration a 'reinstall' or 'upgrade' of that same package.
By default, 'reinstalling' or 'upgrading' a package runs the 'Install' process as well as the 'Uninstall' process...in that order?!?! I don't know why it's done this way but it is what it is.
Sooo, is there a way for a bash script to identify if a package is 'truly' being uninstalled...not being reinstalled or upgraded? If so, what would this bash script look like?
I'm just pulling at straws here since I'm not good at bash scripting...
Replies will be faster at some times of the day than others. If you don't get a reply immediately, either wait or post more information. Sometimes, people aren't posting because they don't quite know what you want and aren't sure what to ask, either.
What's your system? How do you usually install packages?
How is this cydia application typically used? Does it print options when you do cydia --help? I can't find a manual page for it which really limits what I can figure out about it.
I apologize for my ignorance. I'm not sure if a --help page even exists for Cydia.
Cydia is an iPhone application similar to the Apple AppStore which hosts applications (specifically Debian packages). AFAIK, it's Linux-Based. Since it installs Debian packages, each package must have a DEBIAN folder that includes a 'control' file. If desirable, someone could include preinst, postinst, prerm & postrm files using bash script.
My specific bash script is in the postrm file which will initiate a soft-reboot after the uninstall, reinstall, or upgrade is completed.
It helps a fair bit actually, since we now know what context your script's being run inside.
What I would do is env > /tmp/cydia-env-$$ which should dump all available variables in the script to a unique temporary file($$ is the process ID, which changes every time). Then check to see if cydia's setting any relevant variables.
for dir in BKP/*/
do
echo You are in :$dir
done
O/P
--
BKP/201448/
BKP/201449/
BKP/201450/
BKP/201451/
BKP/201452/
BKP/201501/
BKP/201502/
BKP/201503/
BKP/201504/
BKP/201505/
BKP/201506/
BKP/201507/ (3 Replies)
I have a folder that contains many sub folders and files. This tree has to be backed up to an archive system. According to the tech support, one of the archives is failing to back up due to the possibility of trailing spaces on file and folder names. Therefore, I would like to have a script... (16 Replies)
I am using this command to remove all files and folders older than 24 hours;
find /databackup/dbs/* -maxdepth 0 -type d -mtime +0 -exec rm -rf {} \;
However, if/when backups to this folder fail and are not updated, it will completely destroy any backups we have in that folder.
What can I add... (14 Replies)
Hi All,
A site I manage had some javascript inserted into each folders index file. Can anyone priovide me with some ideas on how to use awk, sed or some other bash script to parse through each of the site folders and remove this code? If I have to do it by hand I'm going to go insane. :eek:
... (2 Replies)
Hi
I am using red hat linux, In my folder a strange folder is created i.e. " -a " , folder name is preceded with hyphen. Now if i try to remove with rm -rf -1 , i am unable to do it.
Can anyone please let me know how to do it, & what this kind of folder means
Thanks
Sarbjit (3 Replies)
Hi,
is it possible to remove all duplicate lines from all txt files in a specific folder?
This is too hard for me maybe someone could help.
lets say we have an amount of textfiles 1 or 2 or 3 or... maximum 50
each textfile has lines with text.
I want all lines of all textfiles... (8 Replies)
hi all,
I am currently only need several basic applications for my box (basically : asterisk,apache-php,ssh) . However, i somehow running out of 1 Giga of my compact flash because the base installation in netbsd includes some softwares that I occasionally use
Does any of you could guide me... (0 Replies)
Hi,
Please shed some light on how to quickly remove all the zero bytes in which there are some mixtures of more than zero bytes in it.
For eg:
> ls -lrt
-rw-r--r-- 1 ab noen 0 Jul 27 15:47 supplier_mp.unl
-rw-rw-r-- 1 ab noen 507 Aug 5 14:13... (2 Replies)
Hello,
I'm working on a Solaris 9/Sparc machine and it has the Solaris 10 version of Perl (5.8.8) installed on it, which always requires all kinds of library files that Solaris 9 doesn't come with. I think the best way to do is to uninstall this wrong version and install the correct Solaris 9... (1 Reply)