Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MbetterLiveCD
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mbetter
MbetterLiveCD
Commits
215f1190
Commit
215f1190
authored
Sep 13, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to latest version with wssshc preinstalled
parent
ac9d3b12
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
372 additions
and
1 deletion
+372
-1
MbetterClient
config/includes.chroot/usr/local/bin/MbetterClient
+0
-0
MbetterClient_wrapper.sh
...ig/includes.chroot/usr/local/bin/MbetterClient_wrapper.sh
+3
-1
autoinstallergui
config/includes.chroot/usr/local/bin/autoinstallergui
+0
-0
rustdesk-init
config/includes.chroot/usr/local/bin/rustdesk-init
+227
-0
wssshc_watcher.sh
config/includes.chroot/usr/local/bin/wssshc_watcher.sh
+142
-0
wsssh-tools_1.0.0-1_amd64.deb
wsssh-tools_1.0.0-1_amd64.deb
+0
-0
No files found.
config/includes.chroot/usr/local/bin/MbetterClient
View file @
215f1190
No preview for this file type
config/includes.chroot/usr/local/bin/MbetterClient_wrapper.sh
View file @
215f1190
...
...
@@ -11,5 +11,7 @@ echo ""
echo
"Starting MbetterClient..."
echo
"=========================================="
CLIENT_ID
=
$(
cat
/tmp/IDCLIENT.txt
)
# Execute with all configured settings
exec
/usr/local/bin/MbetterClient
"
$@
"
exec
/usr/local/bin/MbetterClient
--rustdesk_id
$CLIENT_ID
"
$@
"
config/includes.chroot/usr/local/bin/autoinstallergui
0 → 100755
View file @
215f1190
File added
config/includes.chroot/usr/local/bin/rustdesk
→
config/includes.chroot/usr/local/bin/rustdesk
-init
View file @
215f1190
...
...
@@ -8,11 +8,12 @@ RUSTDESK_KEY="MIeh1eaKVfEgjoGFCR4y6j28EVxJNpng7JjBMPk1asM="
CONFIG_DIR
=
""
RUSTDESK_CMD
=
""
TEMP_CONFIG
=
"/tmp/RustDesk_mbetter.toml"
PID_FILE
=
"/tmp/rustdesk_pids_
$(
whoami
)
.txt"
CLIENT_ID
=
"r00000000"
# Fallback ID
# Check for uuidgen command
if
!
command
-v
uuidgen
>
/dev/null 2>&1
;
then
echo
"
$CLIENT_ID
"
echo
-n
"
$CLIENT_ID
"
exit
1
fi
...
...
@@ -26,13 +27,13 @@ elif flatpak list | grep -q "com.rustdesk.RustDesk"; then
CONFIG_DIR
=
"
$HOME
/.var/app/com.rustdesk.RustDesk/config/rustdesk"
RUSTDESK_CMD
=
"flatpak run com.rustdesk.RustDesk"
else
echo
"
$CLIENT_ID
"
echo
-n
"
$CLIENT_ID
"
exit
1
fi
# Check for
start/stop argument
if
[
$#
-
ne
1
]
||
[
"
$1
"
!=
"start"
]
&&
[
"
$1
"
!=
"stop"
]
;
then
echo
"
$CLIENT_ID
"
# Check for
valid arguments
if
[
$#
-
lt
1
]
||
[
"
$1
"
!=
"start"
]
&&
[
"
$1
"
!=
"stop"
]
;
then
echo
-n
"
$CLIENT_ID
"
exit
1
fi
...
...
@@ -40,22 +41,100 @@ ACTION="$1"
CONFIG_FILE
=
"
$CONFIG_DIR
/RustDesk_mbetter.toml"
DEST_CONFIG
=
"
$CONFIG_DIR
/RustDesk2.toml"
RUSTDESK_TOML
=
"
$CONFIG_DIR
/RustDesk.toml"
FORCE
=
0
BACKGROUND
=
0
# Parse arguments for start
if
[
"
$ACTION
"
=
"start"
]
;
then
if
[
$#
-gt
4
]
;
then
echo
-n
"
$CLIENT_ID
"
exit
1
fi
CUSTOM_ID
=
""
for
arg
in
"
$@
"
;
do
if
[
"
$arg
"
=
"--force"
]
;
then
FORCE
=
1
elif
[
"
$arg
"
=
"--background"
]
;
then
BACKGROUND
=
1
elif
[
"
$arg
"
!=
"start"
]
;
then
CUSTOM_ID
=
"
$arg
"
fi
done
fi
case
"
$ACTION
"
in
start
)
# Check if --background is specified and dependencies are available
if
[
$BACKGROUND
-eq
1
]
;
then
if
!
command
-v
Xvfb
>
/dev/null 2>&1
||
!
command
-v
openbox
>
/dev/null 2>&1
||
!
command
-v
xterm
>
/dev/null 2>&1
;
then
echo
-n
"
$CLIENT_ID
"
exit
1
fi
fi
# Check if RustDesk is running and --force is not specified
if
[
$FORCE
-eq
0
]
;
then
if
[
"
$INSTALL_TYPE
"
=
"deb"
]
&&
pgrep
-x
"rustdesk"
>
/dev/null
;
then
# Read existing client ID or use provided ID
if
[
-n
"
$CUSTOM_ID
"
]
;
then
CLIENT_ID
=
"
$CUSTOM_ID
"
if
[
-f
"
$CONFIG_FILE
"
]
;
then
sed
-i
"s/^id = .*/id = '
$CLIENT_ID
'/"
"
$CONFIG_FILE
"
>
/dev/null 2>&1
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
fi
elif
[
-f
"
$CONFIG_FILE
"
]
;
then
CLIENT_ID
=
$(
grep
"^id = "
"
$CONFIG_FILE
"
|
cut
-d
"'"
-f
2
)
if
[
-z
"
$CLIENT_ID
"
]
;
then
CLIENT_ID
=
"r00000000"
fi
fi
echo
-n
"
$CLIENT_ID
"
exit
0
elif
[
"
$INSTALL_TYPE
"
=
"flatpak"
]
&&
flatpak ps |
grep
-q
"com.rustdesk.RustDesk"
;
then
# Read existing client ID or use provided ID
if
[
-n
"
$CUSTOM_ID
"
]
;
then
CLIENT_ID
=
"
$CUSTOM_ID
"
if
[
-f
"
$CONFIG_FILE
"
]
;
then
sed
-i
"s/^id = .*/id = '
$CLIENT_ID
'/"
"
$CONFIG_FILE
"
>
/dev/null 2>&1
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
fi
elif
[
-f
"
$CONFIG_FILE
"
]
;
then
CLIENT_ID
=
$(
grep
"^id = "
"
$CONFIG_FILE
"
|
cut
-d
"'"
-f
2
)
if
[
-z
"
$CLIENT_ID
"
]
;
then
CLIENT_ID
=
"r00000000"
fi
fi
echo
-n
"
$CLIENT_ID
"
exit
0
fi
else
# Kill running RustDesk process if --force is specified
if
[
"
$INSTALL_TYPE
"
=
"deb"
]
;
then
pgrep
-x
"rustdesk"
>
/dev/null
&&
pkill
-x
rustdesk
>
/dev/null 2>&1
elif
[
"
$INSTALL_TYPE
"
=
"flatpak"
]
;
then
flatpak ps |
grep
-q
"com.rustdesk.RustDesk"
&&
flatpak
kill
com.rustdesk.RustDesk
>
/dev/null 2>&1
fi
fi
# Ensure config directory exists and is writable
mkdir
-p
"
$CONFIG_DIR
"
>
/dev/null 2>&1
||
{
echo
"
$CLIENT_ID
"
;
exit
1
;
}
touch
"
$CONFIG_DIR
/.test_write"
>
/dev/null 2>&1
||
{
echo
"
$CLIENT_ID
"
;
exit
1
;
}
mkdir
-p
"
$CONFIG_DIR
"
>
/dev/null 2>&1
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
touch
"
$CONFIG_DIR
/.test_write"
>
/dev/null 2>&1
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
rm
-f
"
$CONFIG_DIR
/.test_write"
>
/dev/null 2>&1
# Check if config file exists
if
[
!
-f
"
$CONFIG_FILE
"
]
;
then
# Generate a new ID using uuidgen
UUID
=
$(
uuidgen
)
||
{
echo
"
$CLIENT_ID
"
;
exit
1
;
}
# Generate or use provided ID
if
[
-n
"
$CUSTOM_ID
"
]
;
then
CLIENT_ID
=
"
$CUSTOM_ID
"
elif
[
!
-f
"
$CONFIG_FILE
"
]
||
[
$FORCE
-eq
1
]
;
then
UUID
=
$(
uuidgen
)
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
CLIENT_ID
=
"r
$UUID
"
else
CLIENT_ID
=
$(
grep
"^id = "
"
$CONFIG_FILE
"
|
cut
-d
"'"
-f
2
)
if
[
-z
"
$CLIENT_ID
"
]
;
then
UUID
=
$(
uuidgen
)
||
{
echo
-n
"r00000000"
;
exit
1
;
}
CLIENT_ID
=
"r
$UUID
"
fi
fi
# Create initial config file in /tmp
cat
>
"
$TEMP_CONFIG
"
<<
EOF
# Create or rewrite config file
cat
>
"
$TEMP_CONFIG
"
<<
EOF
rendezvous_server = '
$RUSTDESK_SERVER
'
nat_type = 1
serial = 0
...
...
@@ -69,28 +148,37 @@ key = '$RUSTDESK_KEY'
custom-rendezvous-server = '
$CUSTOM_SERVER
'
av1-test = 'Y'
password = '
$FIXED_PASSWORD
'
approve-mode = 'password'
verification-method = 'use-permanent-password'
EOF
# Copy to RustDesk2.toml, RustDesk.toml, and RustDesk_mbetter.toml
cp
"
$TEMP_CONFIG
"
"
$DEST_CONFIG
"
>
/dev/null 2>&1
||
{
echo
"
$CLIENT_ID
"
;
exit
1
;
}
cp
"
$TEMP_CONFIG
"
"
$RUSTDESK_TOML
"
>
/dev/null 2>&1
||
{
echo
"
$CLIENT_ID
"
;
exit
1
;
}
cp
"
$TEMP_CONFIG
"
"
$CONFIG_FILE
"
>
/dev/null 2>&1
||
{
echo
"
$CLIENT_ID
"
;
exit
1
;
}
else
# Read existing client ID
CLIENT_ID
=
$(
grep
"^id = "
"
$CONFIG_FILE
"
|
cut
-d
"'"
-f
2
)
if
[
-z
"
$CLIENT_ID
"
]
;
then
UUID
=
$(
uuidgen
)
||
{
echo
"r00000000"
;
exit
1
;
}
CLIENT_ID
=
"r
$UUID
"
sed
-i
"s/^id = .*/id = '
$CLIENT_ID
'/"
"
$CONFIG_FILE
"
>
/dev/null 2>&1
||
{
echo
"r00000000"
;
exit
1
;
}
fi
fi
# Copy to RustDesk2.toml and RustDesk_mbetter.toml
cp
"
$TEMP_CONFIG
"
"
$DEST_CONFIG
"
>
/dev/null 2>&1
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
cp
"
$TEMP_CONFIG
"
"
$CONFIG_FILE
"
>
/dev/null 2>&1
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
# Copy to RustDesk.toml, filtering out password line
grep
-v
"^password = "
"
$TEMP_CONFIG
"
>
"
$RUSTDESK_TOML
"
2>/dev/null
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
# Output the ID
echo
"
$CLIENT_ID
"
# Output the ID
without newline
echo
-n
"
$CLIENT_ID
"
# Launch RustDesk if command is valid
if
command
-v
"
$RUSTDESK_CMD
"
>
/dev/null 2>&1
||
[
"
$INSTALL_TYPE
"
=
"flatpak"
]
;
then
$RUSTDESK_CMD
>
/dev/null 2>&1 &
if
[
$BACKGROUND
-eq
1
]
;
then
# Launch Xvfb, openbox, and xterm, ignoring .xinitrc, and store PIDs
rm
-f
"
$PID_FILE
"
>
/dev/null 2>&1
Xvfb :99
-screen
0 1024x768x16
>
/dev/null 2>&1 &
echo
$!
>>
"
$PID_FILE
"
sleep
1
DISPLAY
=
:99 openbox
>
/dev/null 2>&1 &
echo
$!
>>
"
$PID_FILE
"
sleep
1
DISPLAY
=
:99 xterm
>
/dev/null 2>&1 &
echo
$!
>>
"
$PID_FILE
"
sleep
1
DISPLAY
=
:99
$RUSTDESK_CMD
>
/dev/null 2>&1 &
else
$RUSTDESK_CMD
>
/dev/null 2>&1 &
fi
sleep
2
# Reapply config to RustDesk_mbetter.toml
...
...
@@ -108,18 +196,32 @@ key = '$RUSTDESK_KEY'
custom-rendezvous-server = '
$CUSTOM_SERVER
'
av1-test = 'Y'
password = '
$FIXED_PASSWORD
'
approve-mode = 'password'
verification-method = 'use-permanent-password'
EOF
# Reapply RustDesk2.toml and RustDesk.toml
cp
"
$CONFIG_FILE
"
"
$DEST_CONFIG
"
>
/dev/null 2>&1
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
grep
-v
"^password = "
"
$CONFIG_FILE
"
>
"
$RUSTDESK_TOML
"
2>/dev/null
||
{
echo
-n
"
$CLIENT_ID
"
;
exit
1
;
}
fi
;;
stop
)
# Suppress all output
exec
>
/dev/null 2>&1
# Stop RustDesk
based on installation type
# Stop RustDesk
if
[
"
$INSTALL_TYPE
"
=
"deb"
]
;
then
pgrep
-x
"rustdesk"
>
/dev/null
&&
pkill
-x
rustdesk
elif
[
"
$INSTALL_TYPE
"
=
"flatpak"
]
;
then
flatpak ps |
grep
-q
"com.rustdesk.RustDesk"
&&
flatpak
kill
com.rustdesk.RustDesk
fi
# Stop only Xvfb, openbox, and xterm started by this script
if
[
-f
"
$PID_FILE
"
]
;
then
while
read
-r
pid
;
do
if
[
-n
"
$pid
"
]
&&
ps
-p
"
$pid
"
>
/dev/null 2>&1
;
then
kill
"
$pid
"
>
/dev/null 2>&1
fi
done
<
"
$PID_FILE
"
rm
-f
"
$PID_FILE
"
>
/dev/null 2>&1
fi
;;
esac
config/includes.chroot/usr/local/bin/wssshc_watcher.sh
0 → 100755
View file @
215f1190
#!/bin/bash
# wssshc_watcher.sh - Wrapper script for wssshc with automatic restart functionality
# Copyright (C) 2024 Stefy Lanza <stefy@nexlab.net> and SexHack.me
PID_FILE
=
"/tmp/wssshc_watcher.pid"
WSSSHC_CMD
=
"/usr/bin/wssshc"
# Adjust if wssshc is in a different location
print_usage
()
{
echo
"Usage:
$0
{start|stop|restart|status} [wssshc_args...]"
echo
" start wssshc_args - Start the wssshc watcher with specified arguments"
echo
" stop - Stop the wssshc watcher"
echo
" restart - Restart the wssshc watcher"
echo
" status - Show the status of the wssshc watcher"
echo
""
echo
"Example:
$0
start --server-ip 192.168.1.100 --port 9898 --id myclient --password mysecret"
}
start
()
{
if
[
-f
"
$PID_FILE
"
]
&&
kill
-0
$(
cat
"
$PID_FILE
"
)
2>/dev/null
;
then
echo
"wssshc_watcher is already running (PID:
$(
cat
"
$PID_FILE
"
)
)"
return
1
fi
# Get wssshc arguments from command line
shift
# Remove 'start' from arguments
WSSSHC_ARGS
=
"
$*
"
if
[
-z
"
$WSSSHC_ARGS
"
]
;
then
echo
"Error: No wssshc arguments provided."
echo
"Usage:
$0
start wssshc_args..."
echo
"Example:
$0
start --server-ip 192.168.1.100 --port 9898 --id myclient --password mysecret"
return
1
fi
echo
"Starting wssshc_watcher with arguments:
$WSSSHC_ARGS
"
nohup
"
$0
"
watch
"
$WSSSHC_ARGS
"
>
/tmp/wssshc_watcher.log 2>&1 &
WATCHER_PID
=
$!
echo
$WATCHER_PID
>
"
$PID_FILE
"
echo
"wssshc_watcher started with PID
$WATCHER_PID
"
echo
"Log file: /tmp/wssshc_watcher.log"
}
stop
()
{
if
[
-f
"
$PID_FILE
"
]
;
then
WATCHER_PID
=
$(
cat
"
$PID_FILE
"
)
if
kill
-0
$WATCHER_PID
2>/dev/null
;
then
echo
"Stopping wssshc_watcher (PID:
$WATCHER_PID
)..."
kill
$WATCHER_PID
# Wait for graceful shutdown
for
i
in
{
1..10
}
;
do
if
!
kill
-0
$WATCHER_PID
2>/dev/null
;
then
break
fi
sleep
1
done
# Force kill if still running
if
kill
-0
$WATCHER_PID
2>/dev/null
;
then
kill
-9
$WATCHER_PID
2>/dev/null
fi
fi
rm
-f
"
$PID_FILE
"
echo
"wssshc_watcher stopped"
else
echo
"wssshc_watcher is not running"
fi
}
restart
()
{
echo
"Restarting wssshc_watcher..."
stop
sleep
2
start
}
status
()
{
if
[
-f
"
$PID_FILE
"
]
;
then
WATCHER_PID
=
$(
cat
"
$PID_FILE
"
)
if
kill
-0
$WATCHER_PID
2>/dev/null
;
then
echo
"wssshc_watcher is running (PID:
$WATCHER_PID
)"
# Check if wssshc is also running
WSSSHC_PID
=
$(
pgrep
-f
"
$WSSSHC_CMD
"
)
if
[
-n
"
$WSSSHC_PID
"
]
;
then
echo
"wssshc is running (PID:
$WSSSHC_PID
)"
else
echo
"wssshc is not running (watcher may be restarting it)"
fi
else
echo
"wssshc_watcher PID file exists but process is not running"
rm
-f
"
$PID_FILE
"
fi
else
echo
"wssshc_watcher is not running"
fi
}
watch
()
{
WSSSHC_ARGS
=
"
$1
"
echo
"wssshc_watcher started at
$(
date
)
"
echo
"Monitoring wssshc with arguments:
$WSSSHC_ARGS
"
while
true
;
do
echo
"
$(
date
)
: Starting wssshc..."
$WSSSHC_CMD
$WSSSHC_ARGS
EXIT_CODE
=
$?
echo
"
$(
date
)
: wssshc exited with code
$EXIT_CODE
"
if
[
$EXIT_CODE
-eq
0
]
;
then
echo
"
$(
date
)
: wssshc exited normally, stopping watcher"
break
else
echo
"
$(
date
)
: wssshc crashed or exited with error, restarting in 5 seconds..."
sleep
5
fi
done
echo
"
$(
date
)
: wssshc_watcher exiting"
}
# Main script logic
case
"
$1
"
in
start
)
start
"
$@
"
;;
stop
)
stop
;;
restart
)
restart
;;
status
)
status
;;
watch
)
shift
watch
"
$*
"
;;
*
)
print_usage
exit
1
;;
esac
wsssh-tools_1.0.0-1_amd64.deb
0 → 100644
View file @
215f1190
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment