Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PVEDiscordDark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirror
PVEDiscordDark
Commits
484f831a
Unverified
Commit
484f831a
authored
4 years ago
by
Weilbyte
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #47 from RisedSky/master
Create UtilityUpdater.sh
parents
2e374f77
0522a936
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
UtilityUpdater.sh
+73
-0
73 additions, 0 deletions
UtilityUpdater.sh
with
73 additions
and
0 deletions
UtilityUpdater.sh
0 → 100644
+
73
−
0
View file @
484f831a
#!/bin/bash
#Script by RisedSky to allow users to update their python script of ProxmoxDiscordDark
#Created : 05/12/2020
currentuser
=
`
whoami
|
grep
'root'
`
default
=
"
\e
[39m"
green
=
"
\e
[32m"
red
=
"
\e
[91m"
yellow
=
"
\e
[93m"
clear
echo
-ne
"Verifying that you're root to prevent perm errors
\r
"
sleep
1
if
[
-z
"
$currentuser
"
]
then
echo
-ne
"Verifying that you're root to prevent perm errors
$red
[ERROR]
$default
\r
"
echo
-ne
"
\n
You are not root !"
exit
1
fi
echo
-ne
"Verifying that you're root to prevent perm errors
$green
[OK]
$default
\r
"
echo
-ne
'\n'
sleep
1
echo
-ne
'\n'
sleep
1
echo
-ne
'# (0%) Checking the latestversion\r'
latestversion
=
`
curl
-s
"https://api.github.com/repos/Weilbyte/PVEDiscordDark/releases/latest"
|
awk
-F
'"'
'/tag_name/{print $4}'
`
echo
-ne
'####################### (100%) Checking the latestversion\r'
sleep
1
echo
-ne
'\n'
file
=
"./currentversion.txt"
currentversion
=
""
if
[
!
-f
"
$file
"
]
then
echo
"
$latestversion
"
>
"
$file
"
currentversion
=
"
$latestversion
"
else
currentversion
=
`
cat
$file
`
fi
echo
"Your version :
$currentversion
"
echo
"Latest version :
$latestversion
"
if
[
!
"
$currentversion
"
=
"
$latestversion
"
]
then
#Not up tp date
read
-p
"
$(
echo
-e
$yellow
)
[Warning] Your version is different, would you like to update ?
$(
echo
-e
$default
)
[y/n]"
-n
1
-r
echo
""
# (optional) move to a new line
if
[[
$REPLY
=
~ ^[YyOo]
$
]]
then
echo
-ne
"Downloading...
\n
"
wget
-O
"PVEDiscordDark.py"
"https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.py"
echo
"
$latestversion
"
>
$file
read
-p
"
$(
echo
-e
$yellow
)
[Warning] Start the updated script ?
$(
echo
-e
$default
)
[y/n]"
-n
1
-r
echo
""
# (optional) move to a new line
if
[[
$REPLY
=
~ ^[YyOo]
$
]]
then
python3 PVEDiscordDark.py
exit
0
fi
else
echo
-ne
"Exiting...
\n
"
exit
0
fi
else
#Up to date
echo
-e
"
$green
""You have the latest version of the script !
$default
"
exit
0
fi
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment