relable scripts to rocknix
This commit is contained in:
parent
ce9defa9ad
commit
985b2d8ffc
12 changed files with 40 additions and 41 deletions
|
@ -1 +0,0 @@
|
|||
rocknix-info
|
|
@ -30,17 +30,17 @@ do_remove() {
|
|||
then
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
do_trust() {
|
||||
NPID=$(pgrep -f batocera-bluetooth-agent)
|
||||
NPID=$(pgrep -f rocknix-bluetooth-agent)
|
||||
test -z "${NPID}" && return 0
|
||||
|
||||
touch "/var/run/bt_status" || retrun 1
|
||||
LAST_MSG=$(cat "/var/run/bt_status")
|
||||
|
||||
|
||||
# start discovering
|
||||
kill -10 "${NPID}"
|
||||
|
||||
|
@ -61,11 +61,11 @@ do_trust() {
|
|||
|
||||
# stop discovering
|
||||
kill -12 "${NPID}"
|
||||
|
||||
|
||||
}
|
||||
|
||||
do_starttrust() {
|
||||
NPID=$(pgrep -f batocera-bluetooth-agent)
|
||||
NPID=$(pgrep -f rocknix-bluetooth-agent)
|
||||
test -z "${NPID}" && exit 0
|
||||
|
||||
# start discovering
|
||||
|
@ -73,7 +73,7 @@ do_starttrust() {
|
|||
}
|
||||
|
||||
do_stoptrust() {
|
||||
NPID=$(pgrep -f batocera-bluetooth-agent)
|
||||
NPID=$(pgrep -f rocknix-bluetooth-agent)
|
||||
test -z "${NPID}" && exit 0
|
||||
|
||||
# stop discovering
|
|
@ -4,11 +4,11 @@
|
|||
. /etc/os-release
|
||||
|
||||
if [ ! "$1" ];then
|
||||
echo -e "usage : batocera-config [command] [args]\nWith command in\n\toverscan [enable|disable]\n\tlsaudio\n\tgetaudio\n\taudio [hdmi|jack|auto|custom|x,y]\n\tcanupdate\n\tupdate\n\twifi [enable|disable] ssid key\n\tstorage [current|list|INTERNAL|ANYEXTERNAL|RAM|DEV UUID]\n\tsetRootPassword [password]\n\tgetRootPassword\n\ttz [|tz]"
|
||||
echo -e "usage : rocknix-config [command] [args]\nWith command in\n\toverscan [enable|disable]\n\tlsaudio\n\tgetaudio\n\taudio [hdmi|jack|auto|custom|x,y]\n\tcanupdate\n\tupdate\n\twifi [enable|disable] ssid key\n\tstorage [current|list|INTERNAL|ANYEXTERNAL|RAM|DEV UUID]\n\tsetRootPassword [password]\n\tgetRootPassword\n\ttz [|tz]"
|
||||
exit 1
|
||||
fi
|
||||
configFile="/storage/.config/system/configs/config.txt"
|
||||
storageFile="/storage/.config/system/configs/batocera-boot.conf"
|
||||
storageFile="/storage/.config/system/configs/rocknix-boot.conf"
|
||||
command="$1"
|
||||
mode="$2"
|
||||
extra1="$3"
|
||||
|
@ -40,11 +40,11 @@ bato_config_set_value () {
|
|||
fi
|
||||
}
|
||||
|
||||
#log=/userdata/system/logs/batocera.log
|
||||
#systemsetting="python /usr/lib/python2.7/site-packages/configgen/settings/batoceraSettings.py"
|
||||
#log=/userdata/system/logs/rocknix.log
|
||||
#systemsetting="python /usr/lib/python2.7/site-packages/configgen/settings/rocknixSettings.py"
|
||||
|
||||
log=/var/log/systemsettings.log
|
||||
systemsetting="/usr/bin/batocera-settings"
|
||||
systemsetting="/usr/bin/rocknix-settings"
|
||||
|
||||
|
||||
echo "----config ----" >> $log
|
||||
|
@ -62,7 +62,7 @@ if [ "$command" == "getRootPassword" ]; then
|
|||
then
|
||||
exit 1
|
||||
fi
|
||||
if ! batocera-encode decode "${ENCPASSWD}"
|
||||
if ! rocknix-encode decode "${ENCPASSWD}"
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
@ -83,7 +83,7 @@ if [ "$command" == "setRootPassword" ]; then
|
|||
then
|
||||
PASSWD=$(tr -cd _A-Z-a-z-0-9 < /dev/urandom | fold -w8 | head -n1)
|
||||
fi
|
||||
PASSWDENC=$(batocera-encode encode "${PASSWD}")
|
||||
PASSWDENC=$(rocknix-encode encode "${PASSWD}")
|
||||
|
||||
preBootConfig
|
||||
if grep -qE '^[ \t]*rootshadowpassword[ \t]*=' "${storageFile}"
|
||||
|
@ -155,7 +155,7 @@ fi
|
|||
if [ "$command" == "lsoutputs" ]
|
||||
then
|
||||
echo "auto"
|
||||
batocera-resolution listOutputs
|
||||
rocknix-resolution listOutputs
|
||||
fi
|
||||
|
||||
if [ "$command" == "lsaudio" ];then
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Get RetroAchievements information for Batocera
|
||||
# Get RetroAchievements information for ROCKNIX
|
||||
#
|
||||
# @lbrpdx on Batocera Forums and Discord
|
||||
#
|
||||
|
@ -13,7 +13,7 @@
|
|||
# 20201104 - retroachievements.org HTML changes, again, again
|
||||
#
|
||||
# Usage:
|
||||
# batocera-retroachievements-info
|
||||
# rocknix-retroachievements-info
|
||||
#
|
||||
CONFIGFILE="/storage/.config/system/configs/system.cfg"
|
||||
TIMEOUT=4 # seconds before timeout (>2 sec)
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
systemsetting="/usr/bin/batocera-settings"
|
||||
systemsetting="/usr/bin/rocknix-settings"
|
||||
syslang=$($systemsetting -command load -key system.language)
|
||||
IMGSTYLE=$($systemsetting -command load -key scrapper.style)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# batocera-settings can mimic batoceraSettings.py
|
||||
# rocknix-settings can mimic rocknixSettings.py
|
||||
# goal: abolish this python script, it's useless for the sake of the load feature only
|
||||
# get a more user friendly environment for setting, getting and saving keys
|
||||
#
|
||||
|
@ -22,16 +22,16 @@
|
|||
# boolean value.
|
||||
|
||||
# Examples:
|
||||
# 'batocera-settings --command load --key wifi.enabled' will print out 0 or 1
|
||||
# 'batocera-settings --command write --key wifi.ssid -value "This is my NET"' will set 'wlan.ssid=This is my NET'
|
||||
# 'batocera-settings enable wifi.ssid' will remove # from configfile (activate)
|
||||
# 'batocera-settings disable wifi.enabled' will set key wifi.enabled=0
|
||||
# 'botocera-settings /myown/config.file --command status --key my.key' will output status of own config.file and my.key
|
||||
# 'rocknix-settings --command load --key wifi.enabled' will print out 0 or 1
|
||||
# 'rocknix-settings --command write --key wifi.ssid -value "This is my NET"' will set 'wlan.ssid=This is my NET'
|
||||
# 'rocknix-settings enable wifi.ssid' will remove # from configfile (activate)
|
||||
# 'rocknix-settings disable wifi.enabled' will set key wifi.enabled=0
|
||||
# 'rocknix-settings /myown/config.file --command status --key my.key' will output status of own config.file and my.key
|
||||
|
||||
# by cyperghost - 2019/12/30
|
||||
|
||||
##### INITS #####
|
||||
BATOCERA_CONFIGFILE="/storage/.config/system/configs/system.cfg"
|
||||
ROCKNIX_CONFIGFILE="/storage/.config/system/configs/system.cfg"
|
||||
COMMENT_CHAR_SEARCH="[#|;]"
|
||||
COMMENT_CHAR="#"
|
||||
##### INITS #####
|
||||
|
@ -44,10 +44,10 @@ function get_config() {
|
|||
#Otherwise strip till the equal-char to obtain value
|
||||
local val
|
||||
local ret
|
||||
val="$(grep -E -m1 "^\s*$1\s*=" $BATOCERA_CONFIGFILE)"
|
||||
val="$(grep -E -m1 "^\s*$1\s*=" $ROCKNIX_CONFIGFILE)"
|
||||
ret=$?
|
||||
if [[ $ret -eq 1 ]]; then
|
||||
val="$(grep -E -m1 "^$COMMENT_CHAR_SEARCH\s*$1\s*=" $BATOCERA_CONFIGFILE)"
|
||||
val="$(grep -E -m1 "^$COMMENT_CHAR_SEARCH\s*$1\s*=" $ROCKNIX_CONFIGFILE)"
|
||||
ret=$?
|
||||
[[ $ret -eq 0 ]] && val=$COMMENT_CHAR
|
||||
else
|
||||
|
@ -60,17 +60,17 @@ function get_config() {
|
|||
|
||||
function set_config() {
|
||||
#Will search for first key.name at beginning of line and write value to it
|
||||
sed -i "1,/^\(\s*$1\s*=\).*/s//\1$2/" "$BATOCERA_CONFIGFILE"
|
||||
sed -i "1,/^\(\s*$1\s*=\).*/s//\1$2/" "$ROCKNIX_CONFIGFILE"
|
||||
}
|
||||
|
||||
function uncomment_config() {
|
||||
#Will search for first Comment Char at beginning of line and remove it
|
||||
sed -i "1,/^$COMMENT_CHAR_SEARCH\(\s*$1\)/s//\1/" "$BATOCERA_CONFIGFILE"
|
||||
sed -i "1,/^$COMMENT_CHAR_SEARCH\(\s*$1\)/s//\1/" "$ROCKNIX_CONFIGFILE"
|
||||
}
|
||||
|
||||
function comment_config() {
|
||||
#Will search for first key.name at beginning of line and add a comment char to it
|
||||
sed -i "1,/^\(\s*$1\)/s//$COMMENT_CHAR\1/" "$BATOCERA_CONFIGFILE"
|
||||
sed -i "1,/^\(\s*$1\)/s//$COMMENT_CHAR\1/" "$ROCKNIX_CONFIGFILE"
|
||||
}
|
||||
|
||||
function check_argument() {
|
||||
|
@ -140,10 +140,10 @@ function main() {
|
|||
|
||||
#Filename parsed?
|
||||
if [[ -f "$1" ]]; then
|
||||
BATOCERA_CONFIGFILE="$1"
|
||||
shift
|
||||
ROCKNIX_CONFIGFILE="$1"
|
||||
shift
|
||||
else
|
||||
[[ -f "$BATOCERA_CONFIGFILE" ]] || { echo "not found: $BATOCERA_CONFIGFILE" >&2; exit 2; }
|
||||
[[ -f "$ROCKNIX_CONFIGFILE" ]] || { echo "not found: $ROCKNIX_CONFIGFILE" >&2; exit 2; }
|
||||
fi
|
||||
|
||||
#How much arguments are parsed, up to 6 then it is the long format
|
||||
|
@ -176,8 +176,8 @@ function main() {
|
|||
"stat"|"status")
|
||||
val="$(get_config $keyvalue)"
|
||||
ret=$?
|
||||
[[ -f "$BATOCERA_CONFIGFILE" ]] && echo "ok: found '$BATOCERA_CONFIGFILE'" >&2 || echo "error: not found '$BATOCERA_CONFIGFILE'" >&2
|
||||
[[ -w "$BATOCERA_CONFIGFILE" ]] && echo "ok: r/w file '$BATOCERA_CONFIGFILE'" >&2 || echo "error: r/o file '$BATOCERA_CONFIGFILE'" >&2
|
||||
[[ -f "$ROCKNIX_CONFIGFILE" ]] && echo "ok: found '$ROCKNIX_CONFIGFILE'" >&2 || echo "error: not found '$ROCKNIX_CONFIGFILE'" >&2
|
||||
[[ -w "$ROCKNIX_CONFIGFILE" ]] && echo "ok: r/w file '$ROCKNIX_CONFIGFILE'" >&2 || echo "error: r/o file '$ROCKNIX_CONFIGFILE'" >&2
|
||||
[[ -z "$val" && $ret -eq 1 ]] && echo "error: '$keyvalue' not found!" >&2
|
||||
[[ -z "$val" && $ret -eq 0 ]] && echo "error: '$keyvalue' is empty - use 'comment' command to retrieve" >&2
|
||||
[[ "$val" == "$COMMENT_CHAR" ]] && echo "error: '$keyvalue' is commented $COMMENT_CHAR!" >&2 && val=
|
||||
|
@ -187,7 +187,7 @@ function main() {
|
|||
|
||||
"set"|"write"|"save")
|
||||
#Is file write protected?
|
||||
[[ -w "$BATOCERA_CONFIGFILE" ]] || { echo "r/o file: $BATOCERA_CONFIGFILE" >&2; exit 2; }
|
||||
[[ -w "$ROCKNIX_CONFIGFILE" ]] || { echo "r/o file: $ROCKNIX_CONFIGFILE" >&2; exit 2; }
|
||||
#We can comment line above to erase keys, it's much saver to check if a value is setted
|
||||
[[ -z "$newvalue" ]] && echo "error: '$keyvalue' needs value to be setted" >&2 && exit 1
|
||||
|
||||
|
@ -254,7 +254,7 @@ function main() {
|
|||
# Attention the unset is needed to eliminate first argument (python basefile)
|
||||
|
||||
if [[ "${#@}" -eq 1 && "$1" =~ "mimic_python" ]]; then
|
||||
#batoceraSettings.py fob
|
||||
#rocknixSettings.py fob
|
||||
readarray -t arr <<< "$1"
|
||||
unset arr[0]
|
||||
else
|
|
@ -105,7 +105,7 @@ function bluetooth() {
|
|||
${VERBOSE} && log $0 "Disabling BT"
|
||||
if [[ "${BLUETOOTH_STATE}" == "1" ]]
|
||||
then
|
||||
NPID=$(pgrep -f batocera-bluetooth-agent)
|
||||
NPID=$(pgrep -f rocknix-bluetooth-agent)
|
||||
if [[ ! -z "$NPID" ]]; then
|
||||
kill "$NPID"
|
||||
fi
|
||||
|
@ -115,7 +115,7 @@ function bluetooth() {
|
|||
${VERBOSE} && log $0 "Enabling BT"
|
||||
if [[ "${BLUETOOTH_STATE}" == "1" ]]
|
||||
then
|
||||
systemd-run batocera-bluetooth-agent
|
||||
systemd-run rocknix-bluetooth-agent
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ PartOf=bluetooth.service
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/batocera-bluetooth-agent
|
||||
ExecStart=/usr/bin/rocknix-bluetooth-agent
|
||||
|
||||
[Install]
|
||||
WantedBy=bluetooth.service
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
PKG_NAME="emulationstation"
|
||||
PKG_VERSION="0feded0e3275440b3c2eaddfd778c2cca515be83"
|
||||
PKG_VERSION="8d58779bbf0c49d364590f6b228b05f5367a7ba9"
|
||||
PKG_GIT_CLONE_BRANCH="main"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
|
|
Loading…
Reference in a new issue