install rollback bash to py wirepy and wirepy rollback to py

This commit is contained in:
Désiré Werner Menrath 2024-09-19 20:30:01 +02:00
parent 4e841301f7
commit b633fac5a0
5 changed files with 40 additions and 40 deletions

View File

@ -4,11 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="fix set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open"> <list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/install" beforeDir="false" afterPath="$PROJECT_DIR$/install" afterDir="false" /> <change beforePath="$PROJECT_DIR$/install" beforeDir="false" afterPath="$PROJECT_DIR$/install" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wirepy" beforeDir="false" afterPath="$PROJECT_DIR$/wirepy" afterDir="false" /> <change beforePath="$PROJECT_DIR$/wirepy" beforeDir="false" afterPath="$PROJECT_DIR$/wirepy.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -42,23 +42,23 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;, "ASKED_ADD_EXTERNAL_FILES": "true",
&quot;Python.INSTALL.executor&quot;: &quot;Run&quot;, "Python.INSTALL.executor": "Run",
&quot;Python.install.executor&quot;: &quot;Run&quot;, "Python.install.executor": "Run",
&quot;Python.main.executor&quot;: &quot;Run&quot;, "Python.main.executor": "Run",
&quot;Python.messagebox.executor&quot;: &quot;Run&quot;, "Python.messagebox.executor": "Run",
&quot;Python.start_wg.executor&quot;: &quot;Run&quot;, "Python.start_wg.executor": "Run",
&quot;Python.wg_func.executor&quot;: &quot;Run&quot;, "Python.wg_func.executor": "Run",
&quot;Python.wg_main.executor&quot;: &quot;Run&quot;, "Python.wg_main.executor": "Run",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;Shell Script.install.executor&quot;: &quot;Run&quot;, "Shell Script.install.executor": "Run",
&quot;git-widget-placeholder&quot;: &quot;main&quot;, "git-widget-placeholder": "main",
&quot;last_opened_file_path&quot;: &quot;/home/punix/Pyapps/filebrowserhiddenfiles&quot;, "last_opened_file_path": "/home/punix/Pyapps/wire-py",
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.fileTypes&quot; "settings.editor.selected.configurable": "preferences.fileTypes"
} }
}</component> }]]></component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$" /> <recent name="$PROJECT_DIR$" />
@ -431,7 +431,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1726734843529</updated> <updated>1726734843529</updated>
</task> </task>
<option name="localTasksCounter" value="38" /> <task id="LOCAL-00038" summary="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash">
<option name="closed" value="true" />
<created>1726764877546</created>
<option name="number" value="00038" />
<option name="presentableId" value="LOCAL-00038" />
<option name="project" value="LOCAL" />
<updated>1726764877546</updated>
</task>
<option name="localTasksCounter" value="39" />
<servers /> <servers />
</component> </component>
<component name="UnknownFeatures"> <component name="UnknownFeatures">
@ -472,7 +480,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" /> <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="fixed error when active tunnel is deleted,&#10;now also the Address Label is emptied" />
<MESSAGE value="In FrameWidged Class else Block StrVar, this resorts reference and variable assignment together" /> <MESSAGE value="In FrameWidged Class else Block StrVar, this resorts reference and variable assignment together" />
<MESSAGE value="add method init_and_report and label_empty to Class ShowAddress" /> <MESSAGE value="add method init_and_report and label_empty to Class ShowAddress" />
<MESSAGE value="little fixes in Class Import" /> <MESSAGE value="little fixes in Class Import" />
@ -497,17 +504,7 @@
<MESSAGE value="fix rename in Messagebox warning to error" /> <MESSAGE value="fix rename in Messagebox warning to error" />
<MESSAGE value="set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" /> <MESSAGE value="set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" />
<MESSAGE value="fix set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" /> <MESSAGE value="fix set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" />
<option name="LAST_COMMIT_MESSAGE" value="fix set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" /> <MESSAGE value="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash" />
</component> <option name="LAST_COMMIT_MESSAGE" value="fix a filedialog for hidden Files work&#10;install rollback to bash for start wirepy and wirepy rollback to bash" />
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/wg_main.py</url>
<line>1</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component> </component>
</project> </project>

View File

@ -5,10 +5,10 @@ if [ $? -ne 0 ]
then then
su - su -
apt install python3-tk -y && \ apt install python3-tk -y && \
cp wg_main.py start_wg.py wg_func.py wirepy /usr/bin/ && \ cp wg_main.py start_wg.py wg_func.py wirepy.py /usr/bin/ && \
mkdir -p /etc/wire_py && cp -R wp-icons /usr/share/icons/ && \ mkdir -p /etc/wire_py && cp -R wp-icons /usr/share/icons/ && \
chown -R root:root /etc/wire_py && chmod 755 /etc/wire_py && \ chown -R root:root /etc/wire_py && chmod 755 /etc/wire_py && \
ln -sf /usr/bin/wirepy /usr/local/bin/wirepy >/dev/null && \ ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy >/dev/null && \
cp org.wirepy.policy /usr/share/polkit-1/actions/ && \ cp org.wirepy.policy /usr/share/polkit-1/actions/ && \
cp Wire-Py.desktop /usr/share/applications/ && \ cp Wire-Py.desktop /usr/share/applications/ && \
cp wg_start.services /lib/systemd/system/ && \ cp wg_start.services /lib/systemd/system/ && \
@ -16,10 +16,10 @@ if [ $? -ne 0 ]
else else
sudo apt install python3-tk && \ sudo apt install python3-tk && \
sudo cp wg_main.py start_wg.py wg_func.py wirepy /usr/bin/ && \ sudo cp wg_main.py start_wg.py wg_func.py wirepy.py /usr/bin/ && \
sudo mkdir -p /etc/wire_py && sudo cp -R wp-icons /usr/share/icons/ && \ sudo mkdir -p /etc/wire_py && sudo cp -R wp-icons /usr/share/icons/ && \
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \ sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
sudo ln -sf /usr/bin/wirepy /usr/local/bin/wirepy && \ sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
sudo cp org.wirepy.policy /usr/share/polkit-1/actions/ && \ sudo cp org.wirepy.policy /usr/share/polkit-1/actions/ && \
sudo cp Wire-Py.desktop /usr/share/applications/ && \ sudo cp Wire-Py.desktop /usr/share/applications/ && \
sudo cp wg_start.service /lib/systemd/system/ && \ sudo cp wg_start.service /lib/systemd/system/ && \

View File

@ -299,7 +299,7 @@ class ExportTunnels:
tl = ListTunnels.tl_list() tl = ListTunnels.tl_list()
try: try:
if len(tl) != 0: if len(tl) != 0:
wg_tar = _u, now_datetime wg_tar = '/home/' + str(_u) + now_datetime
p_to_conf = Path('/etc/wire_py/') p_to_conf = Path('/etc/wire_py/')
shutil.make_archive(wg_tar, 'zip', p_to_conf) shutil.make_archive(wg_tar, 'zip', p_to_conf)
#if zip_full != 0: #if zip_full != 0:

3
wirepy
View File

@ -1,3 +0,0 @@
#!/bin/bash
pkexec /usr/bin/wg_main.py

6
wirepy.py Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
from subprocess import check_call
from pathlib import Path
Path.write_text(Path('/tmp/_u'), str(Path.home()))
check_call(['pkexec', '/usr/bin/wg_main.py'])