2022-04-23 09:48:05 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
export GROUP_INPUT=input
|
|
|
|
|
|
|
|
if [ -f /etc/group ]; then
|
|
|
|
if ! grep -q $GROUP_INPUT /etc/group; then
|
|
|
|
echo "Creating group $GROUP_INPUT"
|
|
|
|
|
|
|
|
groupadd $GROUP_INPUT
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Warning: /etc/group not found"
|
|
|
|
fi
|
|
|
|
|
2022-05-12 01:31:31 +00:00
|
|
|
if [ -f /usr/local/sunshine/config/sunshine.conf.old ]; then
|
2022-04-23 09:48:05 +00:00
|
|
|
echo "Restoring old sunshine.conf"
|
2022-05-12 01:31:31 +00:00
|
|
|
mv /usr/local/sunshine/config/sunshine.conf.old /usr/local/sunshine/config/sunshine.conf
|
2022-04-23 09:48:05 +00:00
|
|
|
fi
|
|
|
|
|
2022-05-12 01:31:31 +00:00
|
|
|
if [ -f /usr/local/sunshine/config/apps.json.old ]; then
|
2022-05-06 18:24:39 +00:00
|
|
|
echo "Restoring old apps.json"
|
2022-05-12 01:31:31 +00:00
|
|
|
mv /usr/local/sunshine/config/apps.json.old /usr/local/sunshine/config/apps.json
|
2022-04-23 09:48:05 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Update permissions on config files for Web Manager
|
2022-05-12 01:31:31 +00:00
|
|
|
if [ -f /usr/local/sunshine/config/apps.json ]; then
|
2022-05-06 18:24:39 +00:00
|
|
|
echo "chmod 666 /etc/sunshine/apps.json"
|
2022-05-12 01:31:31 +00:00
|
|
|
chmod 666 /usr/local/sunshine/config/apps.json
|
2022-04-23 09:48:05 +00:00
|
|
|
fi
|
|
|
|
|
2022-05-12 01:31:31 +00:00
|
|
|
if [ -f /usr/local/sunshine/config/sunshine.conf ]; then
|
2022-04-23 09:48:05 +00:00
|
|
|
echo "chmod 666 /etc/sunshine/sunshine.conf"
|
2022-05-12 01:31:31 +00:00
|
|
|
chmod 666 /usr/local/sunshine/config/sunshine.conf
|
2022-04-23 09:48:05 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Ensure Sunshine can grab images from KMS
|
|
|
|
path_to_setcap=$(which setcap)
|
|
|
|
if [ -x "$path_to_setcap" ] ; then
|
|
|
|
echo "$path_to_setcap cap_sys_admin+p /usr/bin/sunshine"
|
|
|
|
$path_to_setcap cap_sys_admin+p $(readlink -f /usr/bin/sunshine)
|
|
|
|
fi
|