reboot

What is the simplest way to reboot after a Setup Project installation completes?

本秂侑毒 提交于 2021-02-08 15:47:06
问题 I hate to ask this question as I am aware that there are plenty of questions about it already, some coming very close to what I am wanting to do: Reboot system from Setup project prompt to reboot computer after installation completed The first one seems to suggest that it is impossible without external software but the second question gives an answer that seems exactly what I want. But I don't really understand what it's referring to when it's suggested to set REBOOT=Force . I read through

How to control a TPLINK router with a python script

泄露秘密 提交于 2020-05-27 08:17:30
问题 I wanted to know whether there is a tool that allows me to connect to a router and shut it down, and then reboot it from a python script. I know that if I write in a python script: import os and then do os.system("ssh -l root 192.168.2.1") , I can connect through python to my router. But then, I don't know how to apply the router's password, and to log into it, in order to reboot it. So after working on it a bit here is the code that I have written in order to connect to my router with an SSH

Start intent after Reboot

怎甘沉沦 提交于 2020-02-23 06:13:15
问题 I have a GPS Service that gets GPS position every 60 seconds. It's working okay, but it doesn't do anything after phone reboot. I tried adding this in a BroadcastReceiver that is working after reboot but nothing happens. Any help would be great; I just need to load my Intents after reboot. //Start intents after reboot if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { context.startService(new Intent(context, DashboardActivity.class)); } GPSActivity.java public int

Start intent after Reboot

China☆狼群 提交于 2020-02-23 06:13:10
问题 I have a GPS Service that gets GPS position every 60 seconds. It's working okay, but it doesn't do anything after phone reboot. I tried adding this in a BroadcastReceiver that is working after reboot but nothing happens. Any help would be great; I just need to load my Intents after reboot. //Start intents after reboot if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { context.startService(new Intent(context, DashboardActivity.class)); } GPSActivity.java public int

Start intent after Reboot

人盡茶涼 提交于 2020-02-23 06:13:09
问题 I have a GPS Service that gets GPS position every 60 seconds. It's working okay, but it doesn't do anything after phone reboot. I tried adding this in a BroadcastReceiver that is working after reboot but nothing happens. Any help would be great; I just need to load my Intents after reboot. //Start intents after reboot if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { context.startService(new Intent(context, DashboardActivity.class)); } GPSActivity.java public int

How to execute a scp command before reboot or shutdown?

跟風遠走 提交于 2020-01-30 04:27:56
问题 I want to upload file before reboot or shutdown. 1.From my vps to vps Setting for upload.service vim /etc/systemd/system/upload.service [Unit] Description=upload files into my vps Before=shutdown.target reboot.target Requires=network-online.target After=network.target [Service] ExecStart=/bin/true ExecStop=/bin/bash /home/upload.sh [Install] WantedBy=multi-user.target Script for upload.sh vim /home/upload.sh /usr/bin/scp -P 22 -i /home/.ssh/id_rsa /home/wp.bak root@remote_ip:/home It is time

How to execute a scp command before reboot or shutdown?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-30 04:27:31
问题 I want to upload file before reboot or shutdown. 1.From my vps to vps Setting for upload.service vim /etc/systemd/system/upload.service [Unit] Description=upload files into my vps Before=shutdown.target reboot.target Requires=network-online.target After=network.target [Service] ExecStart=/bin/true ExecStop=/bin/bash /home/upload.sh [Install] WantedBy=multi-user.target Script for upload.sh vim /home/upload.sh /usr/bin/scp -P 22 -i /home/.ssh/id_rsa /home/wp.bak root@remote_ip:/home It is time

Notification Listener Service does not work after app is crashed

萝らか妹 提交于 2020-01-19 14:21:30
问题 I have a problem on my app and I want to report this bug. I develope the app which can crawls notifications using NotificationListenerService. It works well. But NotificationListenerService class has the problem I think. Because, If the app is crashed, app can't crawl the notification at all, UNTIL the phone reboots. Is anyone who can solve this problem?? Please help me. The bug is very clear!! But It is not easy to find the solution .... 回答1: If do you have already permissions then: In your

Android 2.2: Reboot device programmatically

对着背影说爱祢 提交于 2020-01-19 01:07:53
问题 I would like to know if there is a way to reboot the device through code. Ive tried: Intent i = new Intent(Intent.ACTION_REBOOT); i.putExtra("nowait", 1); i.putExtra("interval", 1); i.putExtra("window", 0); sendBroadcast(i); And added permissions for REBOOT but it still doesnt work. Thanks 回答1: This seemed to work for me: try { Process proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "reboot" }); proc.waitFor(); } catch (Exception ex) { Log.i(TAG, "Could not reboot", ex); } 回答2:

Running script in crontab--reboot: command not found

穿精又带淫゛_ 提交于 2020-01-10 05:32:20
问题 I've set a script in my root crontab that is supposed to restart my machine with the reboot command. However, I am getting a reboot: command not found despite the fact that reboot is in the root user's path. $ sudo su $ which reboot /sbin/reboot $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin My script: #!/bin/bash ping 8.8.8.8 -c 1 > /dev/null 2>&1; exit_code=$? time_stamp=$(date +"%Y%m%d-%H%M") if [ $exit_code -ne 0 ]; then (1>&2 echo "$time_stamp