WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Edit TC-Exit Options  (Read 18399 times)

Offline newbie000

  • Newbie
  • *
  • Posts: 21
Edit TC-Exit Options
« on: April 10, 2012, 04:30:55 AM »
Hi all,

If i would like to hide backup options on TC-Exit menu (shutdown-reboot-backup), to prevent user to save any changes to the OS that has been customized, any file / script i can edit? (in this case only admin allowed to backup: i.e. using terminal).

Have looked at exitcheck.sh, tc-function script, i don't see anything related to menu options..

Thanks!

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11040
Re: Edit TC-Exit Options
« Reply #1 on: April 10, 2012, 08:16:27 AM »
The source to that GUI is available at any mirror, release/src/fltk_projects/exittc. You can compile a custom version that doesn't have the checkbox.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Edit TC-Exit Options
« Reply #2 on: April 10, 2012, 01:28:23 PM »
Hi newbie000
You could try moving  /usr/bin/filetool.sh  and replacing it with a dummy script  that looks like this:
Code: [Select]
#!/bin/sh
exit 0
This may or may not be enough to fool the exit menu as well as the backup app in control panel into thinking the
backup was done. Save the dummy script (called filetool.sh) in /opt and make it part of your backup. Then in your
/opt/bootlocal.sh, add something like this:
Code: [Select]
mv /usr/bin/filetool.sh /root/filetool.sh
chmod 600 /root/filetool.sh
chown root:root /root/filetool.sh
chmod 700 /root
cp /opt/filetool.sh /usr/bin/filetool.sh
chmod 755 /usr/bin/filetool.sh
chown root:root /usr/bin/filetool.sh
After you have created the dummy file and modified the bootlocal.sh script, call up the exit menu, select Reboot, and
let it backup your changes. If it works, the backup functions in the exit menu and control panel will be non-functional
after rebooting. That still leaves the problem of someone finding filetool.sh, and running  sudo /root/filetool.sh -b
from a terminal or a file manager that supports sudo and execute.

Offline cep33920

  • Newbie
  • *
  • Posts: 16
Re: Edit TC-Exit Options
« Reply #3 on: July 27, 2012, 02:19:26 PM »
Hello,

i'm interessed in compiling exittc to set to none the default shutdown or reboot backup option.
I've the sources files (the link from curaga), gcc and even compiletc, but a gcc exittc.cxx -o exittc do nothing,

an advice ?

thanks

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11040
Re: Edit TC-Exit Options
« Reply #4 on: July 27, 2012, 02:39:47 PM »
You don't need to edit it for that, see .profile - you can just set BACKUP=0 so that it defaults to no backup.
The only barriers that can stop you are the ones you create yourself.

Offline cep33920

  • Newbie
  • *
  • Posts: 16
Re: Edit TC-Exit Options
« Reply #5 on: July 27, 2012, 02:54:42 PM »
ok,
thank you curaga,
done in /home/tc/.profile
export BACKUP=0

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 95
Re: Edit TC-Exit Options
« Reply #6 on: February 06, 2019, 08:00:29 PM »
I know this thread is old enough to grow a beard but I'm wondering how to (rather, which file to edit) in order to change the default shutdown menu linked to wbar to make 'reboot' the default option rather than 'shutdown'.  I have looked but not found the answer.

Related to this (but somewhat less important) would be forcing the Power Button to call the same script.

If it matters, this is on a Dell Mini 1010.

I am asking this because I need to out-stupid any users.  I am also working toward a system which protects itself in the case of a power outage.

As always, thanks in advance.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14788
Re: Edit TC-Exit Options
« Reply #7 on: February 06, 2019, 11:45:52 PM »
If you look at the wbar icon desktop file for the exit icon - /usr/local/share/applications/tinycore-exittc.desktop - you will see it points to /usr/local/bin/exittc, provided by the Xprogs extension.

You can find details of exittc at https://github.com/tinycorelinux/fltk_projects/tree/master/exittc showing that it calls, amongst other things, /usr/bin/exitcheck.sh

You can use the acpid extension to execute commands when the power, or other buttons, are pressed.

« Last Edit: February 07, 2019, 12:40:06 AM by Juanito »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Edit TC-Exit Options
« Reply #8 on: February 07, 2019, 01:28:25 AM »
Hi TomyTurbos
I worked out a change that allows the default exit mode of  exittc  to be changed by setting  EXITPROMPT  to "shutdown",
"reboot", or "prompt" in your  /home/tc/.profile  file. The following patch is attached:

    [EDIT]: Patch removed. Revised patch posted in reply #33 and to http://patches.tinycorelinux.net/
« Last Edit: February 09, 2019, 09:00:56 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Edit TC-Exit Options
« Reply #9 on: February 07, 2019, 04:29:26 PM »
Hi TomyTurbos
If you want to try out my patch, here's an easy (I hope) step by step.

Open your  /home/tc/.profile  file and add the following line:
Code: [Select]
export EXITPROMPT="reboot"Save the file and close the editor.

Download the attached bz2 file into your  /home/tc/ directory. Now open a terminal and execute the following commands:
Code: [Select]
tce-load -w compiletc fltk-1.3-dev sstrip
tce-load -i compiletc fltk-1.3-dev sstrip
tar xjvf exittc.tar.bz2
cd exittc
./CompileExittc
cp exittc ~/.local/bin/
export EXITPROMPT="reboot"
./exittc

The  exittc  applet should pop up with the  reboot  option preselected. Click  OK  to let the machine reboot.  When it comes
back up, it should default to  reboot  whether using the icon, the desktop menu, or entering  exittc  at the command line.

Reply #17 in this thread shows a screenshot of commands and expected responses

    [EDIT]: Re-arranged the instructions in an attempt to make them clearer.  Rich
« Last Edit: February 08, 2019, 08:51:05 AM by Rich »

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 95
Re: Edit TC-Exit Options
« Reply #10 on: February 07, 2019, 04:29:49 PM »
Hi TomyTurbos
I worked out a change that allows the default exit mode of  exittc  to be changed by setting  EXITPROMPT  to "shutdown",
"reboot", or "prompt" in your  /home/tc/.profile  file. The following patch is attached:
~snip~

Awesome! 

Now, if only I knew what to do with it!

PS:  You're awesome too, Juanito.

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 95
Re: Edit TC-Exit Options
« Reply #11 on: February 07, 2019, 04:30:48 PM »
I guess we were posting simultaneously.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Edit TC-Exit Options
« Reply #12 on: February 07, 2019, 04:36:15 PM »
Hi TomyTurbos
I guess we were posting simultaneously.
Great minds think alike. :)

... Awesome! 

Now, if only I knew what to do with it!
Well, now you do. Try the instructions in reply #9.

Offline TomyTurbos

  • Jr. Member
  • **
  • Posts: 95
Re: Edit TC-Exit Options
« Reply #13 on: February 07, 2019, 05:40:58 PM »
Well, we're not quite there yet.

First off, the tce-load -w 'etc.' command d/l'ed a LOT of stuff, some of which was already in my tce directory.  I realize this is probably a deficiency in tce-load; only mentioning it to bring it to your attention.

Next, would it not have been more efficient to use '-wi' as the switch rather than doing it separately?  Not that big a deal but I'm a simple guy here...

Also, the explicit path to the tar.bz2 was required.  (in my case it was my tce dir.)

That last step either has me confused and I did it wrong or some combination of the above.  In either event it did not work.  You said, "Finally enter './exittc'".  I tried that in aterm.  I tried it as sudo.  I added it to the .profile file.  Net result is no change, even after reboot.


Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Edit TC-Exit Options
« Reply #14 on: February 07, 2019, 08:16:38 PM »
Well, we're not quite there yet.

First off, the tce-load -w 'etc.' command d/l'ed a LOT of stuff, some of which was already in my tce directory.  I realize this is probably a deficiency in tce-load; only mentioning it to bring it to your attention.

Next, would it not have been more efficient to use '-wi' as the switch rather than doing it separately?  Not that big a deal but I'm a simple guy here...

Also, the explicit path to the tar.bz2 was required.  (in my case it was my tce dir.)

That last step either has me confused and I did it wrong or some combination of the above.  In either event it did not work.  You said, "Finally enter './exittc'".  I tried that in aterm.  I tried it as sudo.  I added it to the .profile file.  Net result is no change, even after reboot.
Hello Tommy,
Next time try using the --help menu,   most if not all programs have a --help (or -h) menu to help with syntax and usage

example
Code: [Select]
tc@box:~$ tce-load --help
Illegal option --
Version 10.0
Usage: tce-load [ -i -w -wi -wo -wil -ic -wic -wicl]{s} extensions
  -i   Loads local extension
  -w   Download extension only
  -wi  Download and install extension
  -wo  Download and create an ondemand item
  Adding -c to any -i option will force a one time copy to file system
  Adding -l to any -i option indicates load only - do not update onboot or ondemand
  Adding -s to any option will suppress OK message used by apps GUI

Example usage:
 Load local extension:
   tce-load -i /mnt/hda1/tce/optional/nano.tcz
 Download into tce/optional directory, updates OnBoot and installs:
   tce-load -w -i nano.tcz
 Download only into tce/optional directory:
   tce-load -w nano.tcz
tc@box:~$

Am fairly sure you'd of figured out what you were not doing right after reading this and tce-load  downloads and install's, it doesn't delete stuff..

:)
« Last Edit: February 07, 2019, 08:25:08 PM by coreplayer2 »