<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=2491&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Autorun a script at boot]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=2491</link>
		<description><![CDATA[The most recent posts in Autorun a script at boot.]]></description>
		<lastBuildDate>Thu, 15 Nov 2018 14:06:12 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12818#p12818</link>
			<description><![CDATA[<div class="quotebox"><cite>ilargi wrote:</cite><blockquote><div><p>Changed code in original message.</p></div></blockquote></div><p>Thanks!</p>]]></description>
			<author><![CDATA[dummy@example.com (yeti)]]></author>
			<pubDate>Thu, 15 Nov 2018 14:06:12 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12818#p12818</guid>
		</item>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12817#p12817</link>
			<description><![CDATA[<p>I stand corrected.<br />Changed code in original message.</p>]]></description>
			<author><![CDATA[dummy@example.com (ilargi)]]></author>
			<pubDate>Thu, 15 Nov 2018 12:31:27 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12817#p12817</guid>
		</item>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12816#p12816</link>
			<description><![CDATA[<div class="quotebox"><cite>ilargi wrote:</cite><blockquote><div><p>Try this:</p><div class="codebox"><pre><code>brightness=&quot;/sys/class/backlight/intel_backlight/brightness&quot;
if [ -f $brightness ] &amp;&amp; [ &quot;$(cat $brightness)&quot; != &quot;3000&quot; ]; then
	tee $brightness 3000
fi</code></pre></div></div></blockquote></div><div class="codebox"><pre><code>	tee $brightness 3000</code></pre></div><p>...will wait for input instead of writing &quot;3000&quot; to the desired location. And create a file named &quot;3000&quot;.</p><p>Can you please try your code before publishing it?</p>]]></description>
			<author><![CDATA[dummy@example.com (yeti)]]></author>
			<pubDate>Thu, 15 Nov 2018 11:51:49 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12816#p12816</guid>
		</item>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12813#p12813</link>
			<description><![CDATA[<p>Try...</p><div class="codebox"><pre><code>echo 3000 &gt; $brightness</code></pre></div><p>Such &quot;tee&quot; tricks typically are used because &quot;sudo echo something &gt;somewhere&quot; still does the output redirection as the calling user because the redirection is done before &quot;sudo&quot; is run. &quot;sudo tee somewhere&quot; writes with &quot;root&quot; rights to &quot;somewhere&quot;&#160; because &quot;tee&quot; opens &quot;somewhere&quot; and that happens with &quot;root&quot; superpowers due to &quot;sudo&quot;. This all does not really matter in &quot;rc.local&quot; because the whole script already runs with &quot;root&quot; rights.</p><p>Switching the interpreter of &quot;rc.local&quot; to &quot;/usr/bin/zsh&quot; is not a good idea because &quot;zsh&quot; is not an essential package. System scripts should use &quot;/bin/sh&quot;.</p><p>But ok: It&#039;s your system.</p>]]></description>
			<author><![CDATA[dummy@example.com (yeti)]]></author>
			<pubDate>Thu, 15 Nov 2018 11:45:54 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12813#p12813</guid>
		</item>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12812#p12812</link>
			<description><![CDATA[<p>Try this:</p><div class="codebox"><pre><code>brightness=&quot;/sys/class/backlight/intel_backlight/brightness&quot;
if [ -f $brightness ] &amp;&amp; [ &quot;$(cat $brightness)&quot; != &quot;3000&quot; ]; then
        echo 3000 &gt; $brightness

fi</code></pre></div><p>Edit: Corrected code error.</p>]]></description>
			<author><![CDATA[dummy@example.com (ilargi)]]></author>
			<pubDate>Thu, 15 Nov 2018 11:38:49 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12812#p12812</guid>
		</item>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12811#p12811</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>Translate all BASHisms to standard SH because:</p></div></blockquote></div><p>I tried it with just </p><div class="codebox"><pre><code>brightness=&quot;/sys/class/backlight/intel_backlight/brightness&quot;
tee $brightness &lt;&lt;&lt; 3000</code></pre></div><p>but that didn&#039;t work, i guess im terrible with SH</p><p>anyway i solved the problem by changing the rc.local from #!/bin/sh -e to #!/usr/bin/zsh&#160; &#160;<img src="http://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /><br />thx guys</p>]]></description>
			<author><![CDATA[dummy@example.com (alphalpha)]]></author>
			<pubDate>Thu, 15 Nov 2018 11:25:40 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12811#p12811</guid>
		</item>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12809#p12809</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>#!/bin/sh -e</p></div></blockquote></div><p>It seems there is the problem, I was running under bash.</p>]]></description>
			<author><![CDATA[dummy@example.com (arnaiz)]]></author>
			<pubDate>Thu, 15 Nov 2018 00:51:02 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12809#p12809</guid>
		</item>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12808#p12808</link>
			<description><![CDATA[<div class="codebox"><pre><code>(yeti@kumari:23)/tmp$ cat -n meep.sh 
     1  #!/bin/sh -e
     2  
     3  if [[ 1 = 1 ]] ; then
     4          echo &#039;boo!&#039;
     5  fi
     6  
     7  tee &lt;&lt;&lt; Moo.
(yeti@kumari:23)/tmp$ ./meep.sh 
./meep.sh: 3: ./meep.sh: [[: not found
./meep.sh: 7: ./meep.sh: Syntax error: redirection unexpected</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (yeti)]]></author>
			<pubDate>Thu, 15 Nov 2018 00:37:30 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12808#p12808</guid>
		</item>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12807#p12807</link>
			<description><![CDATA[<p>For me that script its fine, so try to guest when and who are running /etc/rc.local</p><p>I suggest put something like this on your /etc/rc.local to debug your startup:</p><div class="codebox"><pre><code>date &gt;&gt; /var/log/rc.local.test</code></pre></div><p>if the file its not created, maybe its because /etc/rc.local hasnt execution permissions.</p>]]></description>
			<author><![CDATA[dummy@example.com (arnaiz)]]></author>
			<pubDate>Thu, 15 Nov 2018 00:22:31 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12807#p12807</guid>
		</item>
		<item>
			<title><![CDATA[Re: Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12805#p12805</link>
			<description><![CDATA[<p>Translate all BASHisms to standard SH because:</p><div class="codebox"><pre><code>$ head -1 /etc/rc.local 
#!/bin/sh -e          </code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (yeti)]]></author>
			<pubDate>Wed, 14 Nov 2018 22:46:22 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12805#p12805</guid>
		</item>
		<item>
			<title><![CDATA[Autorun a script at boot]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=12804#p12804</link>
			<description><![CDATA[<p>Hey Guys,<br />i want to run a script each time my computer boots up</p><p>problem is since i compiled a new kernel, my screen backlight will go very dark once open-rc starts booting up<br />i tried the bootloader thing that people suggest on the internet but it only works randomly sometimes</p><p>so i wrote this short script that i want to execute <strong>with root rights</strong> during startup</p><div class="codebox"><pre><code>brightness=&quot;/sys/class/backlight/intel_backlight/brightness&quot;
if [[ -f $brightness ]] &amp;&amp; [[ &quot;$(cat $brightness)&quot; != &quot;3000&quot; ]]; then
tee $brightness &lt;&lt;&lt; 3000
fi</code></pre></div><p>i tried to add it into /etc/rc.local but that does nothing...<br />any ideas how to make it work?</p>]]></description>
			<author><![CDATA[dummy@example.com (alphalpha)]]></author>
			<pubDate>Wed, 14 Nov 2018 20:47:39 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=12804#p12804</guid>
		</item>
	</channel>
</rss>
